-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitch_statement.cpp
More file actions
45 lines (43 loc) · 1.05 KB
/
switch_statement.cpp
File metadata and controls
45 lines (43 loc) · 1.05 KB
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
#include <iostream>
using namespace std;
int main() {
int number;
cout<<"Enter the Number from 1 to 10 = ";
cin>>number;
switch (number)
{
case 1 :
cout<<"The number is 1"<<endl;
break;
case 2 :
cout<<"The number is 2"<<endl;
break;
case 3 :
cout<<"The number is 3"<<endl;
break;
case 4 :
cout<<"The number is 4"<<endl;
break;
case 5 :
cout<<"The number is 5"<<endl;
break;
case 6 :
cout<<"The number is 6"<<endl;
break;
case 7 :
cout<<"The number is 7"<<endl;
break;
case 8 :
cout<<"The number is 8"<<endl;
break;
case 9 :
cout<<"The number is 9"<<endl;
break;
case 10 :
cout<<"The number is 10"<<endl;
break;
default:
cout<<"The number is out of range from 1 to 10"<<endl;
}
return 0;
}