CJCoding With Joseph
15free / daySign inCreate account

Days In The Month

Read a month number (1 to 12) and a year and print how many days that month has in the form Days: <count>. April, June, September and November have 30 days; February has 29 in a leap year and 28 otherwise, where a leap year is divisible by 4 but not by 100, or divisible by 400 (use the remainder operator %); every other month has 31. Input: two lines, the month then the year, each an integer, no prompts. Output: one line.

Expected Output:

Days: 29

= newline. The output ends with a newline — print one after the last line.

Hints4 available
Topics:
If StatementsOperators
📥 Auto-Input:
2\n2024\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.