• Follow Us

Leap year program in C

C programming Language.

What is A Leap Year?

Mathematically, If a Year is divided by 4 and the remainder is zero then the year is a leap year.

C Program to implement Leap year concept

#include<stdio.h>
int main()
{
int year;
scanf("%d",&year);
if(year%4!=0)
{
printf("%d is not a leap year",year);
}
else if(year%100!=0)
{
printf("%d is a leap year",year);
}
else if(year%400!=0)
{
printf("%d is not a leap year",year);
}
else
{
printf("%d is a leap year",year);
}
return 0;
}

Leave a Reply

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

Shopping cart