Take a year as input and determine whether it leap or not.

#include <stdio.h>

int main(void)
{
int year;

printf("\nEnter a year : ");
scanf("%d", &year);

if((year % 100 == 0 && year % 400 == 0) || (year % 100 != 0 && year % 4 == 0))
{
printf("\n%d is a leap year",year);
}
else
{
printf("\n%d is NOT a leap year",year);
}


return 0;
}

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin