We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b1f0c54 commit 82385f4Copy full SHA for 82385f4
Level 2/switch_case.cpp
@@ -0,0 +1,38 @@
1
+#include <iostream>
2
+
3
+using namespace std;
4
5
+int main()
6
+{
7
+ int a, b;
8
9
+ cout << "Enter two numbers : " << endl;
10
11
+ cin >> a >> b;
12
13
+ char op;
14
15
+ cout << "Enter the operation which you want to perform : " << endl;
16
17
+ cin >> op;
18
19
+ switch (op)
20
+ {
21
+ case '+':
22
+ cout << "Addition of two numbers : " << a + b << endl;
23
+ break;
24
+ case '-':
25
+ cout << "Subtraction of two numbers : " << a - b << endl;
26
27
+ case '*':
28
+ cout << "Multiplication of two numbers : " << a * b << endl;
29
30
+ case '/':
31
+ cout << "Division of two numbers : " << a / b << endl;
32
33
+ default:
34
+ cout << "You enter invalid operatio" << endl;
35
+ }
36
37
+ return 0;
38
+}
0 commit comments