forked from iamAnki/CPP-Programs-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNums-Comparison.cpp
More file actions
41 lines (36 loc) · 827 Bytes
/
Nums-Comparison.cpp
File metadata and controls
41 lines (36 loc) · 827 Bytes
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
#include <iostream>
#include <iomanip>
using namespace std;
int main(){
int num1,num2;
cout<<" Enter the 1st Number : ";
cin >> num1;
cout<<endl;
cout <<" Enter the 2nd Number : ";
cin >> num2;
cout<<endl;
cout<<" ---------------------------"<<endl;
switch(num1>num2){
case 1:
cout<<" The 1st Number is Greater"<<endl;
break;
}
switch(num1<num2){
case 1:
cout<<" The 2nd Number is Greater"<<endl;
break;
switch(num2<num1){
case 1:
cout<<" The 2nd Number is Smaller"<<endl;
}
switch(num2=num1){
case 1:
cout<<" The 2nd Number is Equal to 1st Number"<<endl;
}
switch(num1=num2){
case 1:
cout<<" The 1st Number is equal to 2nd Number";
}
}
cout<<" ---------------------------"<<endl;
}