CJCoding With Joseph

Days in a Month

Read 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
Topics:
If Statements
๐Ÿ“ฅ Auto-Input:
2\n
This input is automatically fed to your program's stdin
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.