-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGreatestNo.cpp
51 lines (46 loc) · 945 Bytes
/
GreatestNo.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include<iostream>
using namespace std;
int main(){
int num1 , num2, num3 , num4 ;
cout<<"Enter the Num1 : ";
cin>>num1;
cout<<"Enter the Num2 : ";
cin>>num2;
cout<<"Enter the Num3 : ";
cin>>num3;
cout<<"Enter the Num4 : ";
cin>>num4;
if(num1 > num2 ){
if (num1 > num3){
if(num1 > num4){
cout<<num1<<" is Greatest \n";
}
else{
cout<<num4<<" is Greatest \n";
}
}
}
else if (num2 > num3){
if(num2 > num4){
cout<<num2<<" is Greatest \n";
}
else{
cout<<num4<<" is Greatest \n";
}
}
else if (num3 > num4){
cout<<num3<<" is Greatest \n";
}
else{
cout<<num4<<" is Greatest \n";
}
return 0;
}
/*
OutPut :
Enter the Num1 : 45
Enter the Num2 : 25
Enter the Num3 : 21
Enter the Num4 : 21
45 is Greatest
*/