Commit 542ee01
committed
feat: Implement menu-driven arithmetic calculator using switch-case and string input
🧠 Logic:
- Displays a menu with options: ADD, SUB, MUL, DIV.
- Takes two integer inputs from the user.
- Reads arithmetic operation as a string and converts it to uppercase for case-insensitive comparison.
- Uses a `switch-case` on the entered option to:
- Perform addition, subtraction, multiplication, or division.
- Print the corresponding result.
- If the input is invalid, it shows an "Invalid Option" message.
Signed-off-by: Somesh diwan <[email protected]>1 parent e1f7262 commit 542ee01
1 file changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
| 38 | + | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
0 commit comments