-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathswitch.cpp
More file actions
33 lines (28 loc) · 783 Bytes
/
Copy pathswitch.cpp
File metadata and controls
33 lines (28 loc) · 783 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
//============================================================================
// Name : switch.cpp
// Author : John Purcell
// Version :
// Copyright : Your copyright notice
// Description : Explanation of Switch statement through a code
//============================================================================
#include <iostream>
using namespace std;
int main() {
char choice;
cout<<"Enter your choice : \n";
cin>>choice;
switch (choice) {
case 'A':
cout << "You entered the choice A ^^" << endl;
break;
case 'B':
cout << "You entered the choice B ^^" << endl;
break;
case 6:
cout << "You entered the choice C ^^" << endl;
break;
default:
cout << "No choice matched , Hence the default case will execute" << endl;
}
return 0;
}