Find Maximum value program in C++ (C Plus Plus).
Find Maximum value program in C++ (C Plus Plus).
In this tutorial, we will see the program to find the Maximum value in C++ (C Plus Plus).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #include <iostream> using namespace std; int main() { int a,b,c,max; cout<<"Enter First Value "; cin>>a; cout<<"Enter Second Value "; cin>>b; cout<<"Enter Thrid Value "; cin>>c; max=a; if(b>max) max=b; if(c>max) max=c; cout<<"The maximun value is "<<max<<endl; } |
Output:
