Breaking News

C++ program to find the maximum number between 3 numbers

C++ program to find the maximum number between 3 numbers
I will use IF STATEMENT
/*STRUCTURE FOR THE IF ELSE IF...else STATEMENT
***********************
if(Condition){
    #statement
}
else if(Condition2){
    #statement 2
}
else{
    #statement3
}
***********************
*/

1:  #include <iostream>  
2:  using namespace std;  
3:  int main()  
4:  {  //declaration of the variable  
5:    int number1;  
6:    int number2;  
7:    int number3;  
8:      //Give the instruction to the user what to do!!  
9:      cout<<"Enter the First number ";  
10:      cin >>number1;  
11:      cout<<"Enter the Second number ";  
12:      cin >>number2;  
13:      cout<<"Enter the Third number ";  
14:      cin >>number3;  
15:      cout<<endl;  
16:        //using of If else statement  
17:        if(number1>number2 && number1>number3){  
18:          cout<<"The number "<<number1<<" is greater than number "<<number2<<" and "<<number3<<endl;  
19:        }  
20:        else if(number2>number1 && number2>number3){  
21:          cout<<"The number "<<number2<<" is greater than number "<<number1<<" and "<<number3<<endl;  
22:        }  
23:        else{  
24:          cout<<"The number "<<number3<<" is greater than number "<<number1<<" and "<<number2<<endl;  
25:        }  
26:    return 0;  
27:  }