Days in a Month
mediumQuestion 336Read a month number from 1 to 12 with scanf and print how many days it has (treat February as 28, ignoring leap years). Print just the number with no trailing newline.
February (2) has 28. April, June, September, and November (4, 6, 9, 11) have 30. Every other month has 31.
For input 2 the output is 28; for 4 it is 30; for 1 it is 31.
Expected output
28= newline. No newline after the last line.
Hints4 available
Sign in to use hintsTopics
If Statements
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.