/* EXPERIMENT - 4 */ /* AIM : TO CHECK WHETHER A GIVEN YEAR IS A LEAP YEAR OR NOT. */ /* PROGRAMMER : SHEKHAR A. SHERIKAR */ /* COMPUTER TECHNOLOGY - CM102 (B3) */ main() { int Year; clrscr(); printf("\n\n\n\n\t\tThis program will help you to check whether"); printf("\n\t\t a given year is a leap year or not."); printf("\n\n\t\t\t Enter the year:"); scanf("%d",&Year); printf("\n\n\n\t\t\t\t A N S W E R"); if(Year%100==0) /*To check wheather the year is a century year*/ { if(Year%400==0) /*To check wheather the century year is a leap year*/ /*If the year is a leap year, the following statement is executed:*/ printf("\n\n\t\t\t The year %d is a leap year.",Year); else /*If the year is not a leap year, the following statement is executed:*/ printf("\n\n\t\t\tThe year %d is not a leap year.",Year); } else { if(Year%4==0) /*To check wheather the number is divisible by 4*/ /*If the year is a leap year, the following statement is executed*/ printf("\n\n\t\t\t The year %d is a leap year.",Year); else /*If the year is not a leap year, the following statement is executed*/ printf("\n\n\t\t\tThe year %d is not a leap year.",Year); } getch(); }