C Program to check whether the current year is a leap year or not | C Programming
C Program to check whether the current year is a leap year or not
#include <stdio.h>
int main()
{
int a;
printf("Enter the current year:");
scanf("%d", &a);
if (a % 4 == 0 && a % 100 == 0 && a % 400 == 0)
printf("It is a leap year.");
else if (a % 4 == 0 && a % 100 != 0)
printf("It is a leap year.");
else
printf("It is not a leap year.");
return 0;
}
Comments
Post a Comment
Subscribe Us and Thanks for visiting blog.