Answers for "how to find maximum value in c++"

C++
6

c++ max of array

cout << " max element is: " << *max_element(array , array + n) << endl;
Posted by: Guest on May-22-2020
1

c++ how to get maximum value

x = 1, y  = 2;
fmax(x , y);
//if you want to print it right away:
cout << fmax(x , y);
//if you want to store it:
int j = fmax(x, y);
cout << j;

//output 2
Posted by: Guest on April-06-2021
0

how to find maximum value in c++

int maximumValue(int array[] , int n){
  int max=array[0];
  for int i=1;i < n;i++ {
    if (array[i] > max)
      max = array[i];
    
  }
  return max;
}
Posted by: Guest on December-04-2020

Code answers related to "how to find maximum value in c++"

Browse Popular Code Answers by Language