-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path3_2_switch_statement.cpp
59 lines (45 loc) · 978 Bytes
/
3_2_switch_statement.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
52
53
54
55
56
57
58
59
#include<iostream>
using namespace std;
int main(){
char button;
cout<<"Input a charater : ";
cin>>button;
switch(button)
{
case 'a':
cout<<"Hello"<<endl;
break;
case 'b':
cout<<"Namaste"<<endl;
break;
case 'c':
cout<<"Hola"<<endl;
break;
case 'd':
cout<<"Bonjour"<<endl;
break;
case 'e':
cout<<"Ciao"<<endl;
break;
default:
cout<<"I am still learning more"<<endl;
break;
}
return 0;
}
/* int main(){
char button;
cout<<"Input a character : ";
cin>>button;
if(button=='a')
{cout<<"Hello"<<endl;}
if(button=='b')
{cout<<"Namaste"<<endl;}
if(button=='c')
{cout<<"Hola"<<endl;}
if(button=='d')
{cout<<"Bonjour"<<endl;}
if(button=='e')
{cout<<"Ciao"<<endl;}
return 0;
} */