Largest integer value

Description:

Write a C++ program to find the max of an integral data set. The program will ask the user to input the number of data values in the set and each value. The program prints on screen a pointer that points to the max value. Test Case 1 Input (stdin) 5 1 2 3 4 5 Expected Output Largest integer value in the array is 5 Test Case 2 Input (stdin) 3 78 67 46 Expected Output Largest integer value in the array is 78

Program :

#include <iostream>

using namespace std;

int main()

{

  int i,n;

  float arr[100];

  cin>>n;

  for(i=0;i<n;++i)

  {

    cin>>arr[i];

  }

  for(i=0;i<n;++i)

  {  

    if(arr[0]<arr[i])

      arr[0]=arr[i];

  }

  cout<<"Largest integer value in the array is "<<arr[0];

 

return 0;

}