C Program to Find Number of Days in a Month

In this tutorial you will learn about the C Program to Find Number of Days in a Month and its application with practical example.

C Program to Find Number of Days in a Month

In this tutorial, we will learn to create a C program that will Find the Number of Days in a Month using C programming.

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • Conditional Statements in C programming.
  • Arithmetic operations in C Programming.

Algorithm:-

Find Number of Days in a Month:-

In today’s program, we will take the input month in a range between 1 to 12 from the user. Then we will pass that variable to the conditional statements to find the number of days. At last, we will print the resulting number of days to the user.

With the help of the below program, we can find the number of days in a month.

Program Code:-

 

Output:-

In the above program, we have first initialized the required variable.

  • month = it will hold the integer value for the input.

Taking the input month from the user.

Finding the number of days in a month.

Printing output.

In this tutorial we have learn about the C Program to Find Number of Days in a Month and its application with practical example. I hope you will like this tutorial.