Leap year

Program to check whether the entered year is a Leap year or not..

#include<stdio.h>
#include<conio.h>

int main(void)
{
int year;
printf("Enter the year: ");
scanf("%d",&year);

if(year%400 ==0 || (year%100 != 0 && year%4 == 0))
{
printf("Year %d is a leap year",year);
}
else
{
printf("Year %d is not a leap year",year);
}
return 0;
getch();
}
Category:

0 comments: