finding maximum of array in C++ code example
Example 1: c++ max of array
cout << " max element is: " << *max_element(array , array + n) << endl;
Example 2: max element in array
int max;
max=INT_MIN;
for(int i=0;imax){
max=ar[i];
}
cout << " max element is: " << *max_element(array , array + n) << endl;
int max;
max=INT_MIN;
for(int i=0;imax){
max=ar[i];
}