maximum value in a array 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;i<ar.length();i++){
if(ar[i]>max){
max=ar[i];
}