Commit 6c88336
committed
feat: Implement month name mapping using switch-case based on user input
🧠 Logic:
- Program prompts the user to enter a number (1–12) to identify the corresponding month.
- Utilizes a `switch` statement to match the input with the correct month abbreviation (e.g., 1 → Jan, 12 → December).
- Includes a `default` case to handle invalid inputs outside the 1–12 range, enhancing robustness.
- Demonstrates practical use of switch-case for value-to-string mapping in calendar-based logic.
Signed-off-by: Somesh diwan <[email protected]>1 parent 54c998e commit 6c88336
1 file changed
+15
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 12 | + | |
| 13 | + | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
19 | | - | |
20 | | - | |
| 17 | + | |
21 | 18 | | |
22 | 19 | | |
23 | 20 | | |
24 | | - | |
25 | | - | |
| 21 | + | |
26 | 22 | | |
27 | 23 | | |
28 | 24 | | |
29 | | - | |
30 | | - | |
| 25 | + | |
31 | 26 | | |
32 | 27 | | |
33 | 28 | | |
34 | | - | |
35 | | - | |
| 29 | + | |
36 | 30 | | |
37 | 31 | | |
38 | 32 | | |
39 | | - | |
40 | | - | |
| 33 | + | |
41 | 34 | | |
42 | 35 | | |
43 | 36 | | |
44 | | - | |
45 | | - | |
| 37 | + | |
46 | 38 | | |
47 | 39 | | |
48 | 40 | | |
49 | | - | |
50 | | - | |
| 41 | + | |
51 | 42 | | |
52 | 43 | | |
53 | 44 | | |
54 | | - | |
55 | | - | |
| 45 | + | |
56 | 46 | | |
57 | 47 | | |
58 | 48 | | |
59 | | - | |
60 | | - | |
| 49 | + | |
61 | 50 | | |
62 | 51 | | |
63 | 52 | | |
64 | | - | |
65 | | - | |
| 53 | + | |
66 | 54 | | |
67 | 55 | | |
68 | 56 | | |
69 | | - | |
70 | | - | |
| 57 | + | |
71 | 58 | | |
72 | 59 | | |
73 | 60 | | |
74 | | - | |
75 | | - | |
| 61 | + | |
76 | 62 | | |
77 | 63 | | |
78 | 64 | | |
79 | 65 | | |
80 | 66 | | |
81 | | - | |
| 67 | + | |
0 commit comments