Menu
Coddy logo textTech

Months

Lesson 5 of 32 in Coddy's Coding Problems course.

Create a program which will calculate how many days are there in a month. The months will be given with a number.

 

challenge icon

Challenge

Easy

Write a program that gets a natural number N from input representing the number of the month and outputs the number of days in that month.

We will assume that it's not a leap year, so February has 28 days

 

Input
1

Output
31

Input
9

Output
30

Try it yourself

#include <stdio.h>

int main() {
    // Write code here
    return 0;
}

All lessons in Coding Problems