Answers for "how to find max any numbers c++"

C++
2

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

max two numbers c++

template <class T> inline T max(T a, T b)
{ 
  return a > b ? a : b;
}
//Example: max(2,5) = 5
Posted by: Guest on May-05-2021

Code answers related to "how to find max any numbers c++"

Browse Popular Code Answers by Language