C Program to find the Leap Year

In this tutorial you will learn about the C Program to find the Leap Year and its application with practical example.

C Program to find the Leap Year

In this tutorial, we will learn to create a C program that will find the Leap Year in 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.

What is a Leap year?

A leap year contains 366 days. Leap year occurs every fourth year and has one extra day that day is adjusted in February month. The leap year means a year that must be divisible by four rather than the end-of-century years, which must be divisible by 400. This means that the year 2000 was a leap year, but 1900 was not.

Algorithm:-

Program to find the Leap Year

In this program today, we will take the integer input from the user as a year and store it in a variable. Then we will pass that variable to a conditional statement to check whether it’s a leap year or not. After that, we will print the output to the console.

With the help of this program, we can find the Leap Year.

Program code:-

Output:-

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

  • yr = it will hold the integer value.

Taking input year from the user.

Calculating the leap year using the program.

Printing Output year.

In this tutorial we have learn about the C Program to find the Leap Year and its application with practical example. I hope you will like this tutorial.