#include<stdio.h>

#include<conio.h>

int main()

{

int year;

clrscr();

printf(“Enter a year”);

scanf(“%d”, &year);

if( year%400 == 0)

printf(“%d is a leap year.\n”, year);

else if( year%100 == 0)

printf(“%d is not a leap year.\n”, year);

else if( year%4 == 0 )

printf(“%d is a leap year.\n”, year);

else

printf(“%d is not a leap year.\n”, year);

getch();

return(0);

}

Output :-

**Explanation :-**

A year that has 366 days is called a leap year.A year can be checked whether a year is leap year or not by dividing the year by 4, 100 and 400. If a number is divisible by 4 but not by 100 then, it is a leap year. Also, if a number is divisible by 4, 100 and 400 then it is a leap year. Otherwise the year is not a leap year.

### Like this:

Like Loading...