Back To C Flow of Control Index
//program to input a year and find whether it is a leap year or not using if-else statement #include
#include
void main() { int year; clrscr(); printf("\nenter year "); scanf("%d",&year); if((year%100==0) || (year%400==0)) { printf("\nleap year\n"); } else { if(year%4==0) { printf("\nleap year\n"); } else { printf("\nnot a leap year"); } } getch(); }