Computer Science, asked by cutetanya, 1 year ago

write a c++ program using switch to accept month of year (in digits)and display the month name


NeoHBz: can write in JavaScript, can you convert to Java?

Answers

Answered by srijan041
2
I don't know syntax of C++, but I can tell you the logic.
Create an linear array of String of length 12 (index 0 - 11). Now write the names of each month in each indexes serially. Now take the user input and add 1 to it and show the month name.
For eg : User input = 5
After adding 1, it becomes 6
arr[6] is June. So print June.
Similar questions