# Write a C program to check if a given year is a Leap Year

Write a C program to check if a given year is a Leap Year

#include; #include ; int main() { int year; clrscr(); printf("Enter a year: "); scanf("%d",&year); if(year>;0) { if(year%4 == 0) { if( year%100 == 0) { // If year is divisible by 400, than the year is a leap year if ( year%400 == 0) printf("%d is a leap year.", year); // Any year in multiple of 100 which is not divisible by 400 is not a leap year else printf("%d is not a leap year.", year); } else // If the year is not divisible by 100 and but the year is by 4 is a leap year printf("%d is a leap year.", year ); } else printf("%d is not a leap year.", year); } else printf("Please enter year greater than 0"); getch(); return 0; }