Leap Year Program in C

Leap Year Program in C

Here, you will get an example code of Leap Year Program in C programming using various methods.

Leap Year Program in C

 

What is Leap Year?

A leap year is a calendar year that contains an additional day in the month of February So the year contains 366 days instead of 365 days.
In other words, the year of 366 days is known as leap year. Leap years repeat every 4 years.

leap year examples are:- 1996, 2000, 2004, 2008, and 2012.

While 1400, 1500, 1700 are century years, and not leap years.

How to find leap year using C programming?

To check whether the given year is a leap year or not, the user has to check the following rules.

⮞ Year should be divisible by 4.

⮞ Year should be divisible by 400 and not divisible by 100.

Leap Year Data Flow Diagramleap year DFD

How to Implement Leap Year Program in C?

Output 1

Enter a year: 1700

1700 is not a Leap Year

Output 2

 Enter a year:  2020

 2020 is a Leap Year

Program to check Leap Year using nested if – else

Output 1 :

    Enter a year:  2011

    2011 is not a Leap Year

Output 2 :

    Enter a year:  2000

    2000 is a Leap Year

Check out our other C programming Examples

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top