Commit d3f6d41
committed
feat: Implement switch-case arithmetic calculator for two integers
🧠 Logic:
- Reads two integers and a character operator as input.
- Uses a `switch` statement to determine which arithmetic operation to perform: +, -, *, or /.
- For valid operators, prints the result of the operation.
- If the operator is not recognized, prints "Invalid operator".
- Division assumes non-zero denominator as guaranteed by problem constraints.
Signed-off-by: Somesh diwan <someshdiwan369@gmail.com>1 parent d1c8d1b commit d3f6d41
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
0 commit comments