A C++ program that inputs three numbers and displays the maximum number.
#include<iostream>
#include<conio.h>
using namespace std;
main()
{
int a,b,c,max;
cout<<"Enter first number : ";
cin>>a;
cout<<"Enter second number : ";
cin>>b;
cout<<"Enter third number : ";
cin>>c;
max=a;
if(b>max)
max=b;
if(c>max)
max=c;
cout<<"The maximum number is : "<<max;
return 0;
}
output:
Enter first number : 23
Enter second number : 24
Enter third number : 25
The maximum number is : 25
0 Comments