Coding Challenge: Number of Days in a Month

Learn how to write a program to display a number of days in a month.

Problem statement

Write a program that accepts a month number (between 11 and 1212), then show the number of days of that month. Leap years are excluded. Incorrect inputs must be taken into account.

Input

Enter month number: 4

Expected output

Number of days: 30

Coding exercise

Get hands-on with 1200+ tech skills courses.