C program to find whether a given year is a leap year or not

C program to find whether a given year is a leap year or not

Write a C program to find whether a given year is a leap year or not.


#include 
Int main()
{
 int year;
 printf("Input a year :");
 scanf("%d", &year);
 if ((year % 400) == 0)
 printf("%d is a leap year.\n", year);
 else if ((year % 100) == 0)
 printf("%d is a not leap year.\n", year);
 else if ((year % 4) == 0)
 printf("%d is a leap year.\n", year);
 else
 printf("%d is not a leap year \n", year);
 return 0;
}


C Program to Check/find whether a given year is a leap year or not using if-else.