Days in a Month
hardQuestion 247Two variables are given: month (1 to 12) and year. Print Days: <n> where n is the number of days in that month. April, June, September and November have 30 days; February has 28, or 29 in a leap year (divisible by 4 but not by 100, unless divisible by 400); every other month has 31. Use || to group the 30-day months and nest the leap-year test inside the February branch.
Expected output
Days: 29= newline. The output ends with a newline, so print one 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 (clog, fn, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.