100 Most Important C# Programs
6. Program to accept a year and check whether the given year IS leap year or not.
Code:
# include <stdio.h>
# include <conio.h>
main( )
{
int y;
clrscr( );
printf(“enter a year:”);
scanf(“%d”,&y);
if(y%4==0& &y%100!=0|| y%400==0);
printf(“the above given year IS a leap
year”);
else
printf(“the above given year IS not a leap
year”);
getch();
}