Write a program in C to check whether a year is leap year or not.

Example:

A year is said to be a leap year if it is divisible by 4. It mostly occurs every 4 years but every 100 years we skip a leap year unless it is divisible by 400.

If a year is divisible by 4 then it is not necessary that it is a leap year. To be called a lep year the following condition should be satisfied.

  • If a year is divisible by 4 then it should not be divisible by 100. Else,
  • The year should be divisible by 400.

If neither of the condition gets satisfied then the year is not a leap year.

Let’s see the source code to check the leap year in C.

Output 1

Output 2

If you have any doubts or suggestion then please comment below.

Leave a Reply

Close Menu