C Program to check that given year is leap year or not in C language
#include<stdio.h>
int main()
{
int year;
printf("Enter year : ");
scanf("%d",&year);
if( ( (year % 4 == 0) && (year % 100 != 0) ) || (year % 400 == 0) )
printf("%d is a leap year",year);
else
printf("%d is a ordinary year",year);
return 0;
}
int main()
{
int year;
printf("Enter year : ");
scanf("%d",&year);
if( ( (year % 4 == 0) && (year % 100 != 0) ) || (year % 400 == 0) )
printf("%d is a leap year",year);
else
printf("%d is a ordinary year",year);
return 0;
}
0 comments :
Post a Comment