check a year is Leap year or not in C
#include<stdio.h>
int main()
{
int year;
printf("Enter the year\n");
scanf("%d", &year);
if (((year % 4 == 0) && (year % 100!= 0 )) || (year%400 == 0))
printf("This year is Leap year %d\n", year);
else
printf("This year is not Leap year %d\n", year);
return 0;
}
Comments
Post a Comment