C Source Codes List | Source Code Home
Program : Program to find whether a given year is leap year or not.
/* PROGRAM TO FIND WHETHER A GIVEN YEAR IS LEAP YEAR OR NOT */
#include
#include
void main()
{
int year,leap;
clrscr();
printf("enter the year:- ");
scanf("%d",&year);
if ((year%100)==0)
leap=(year/400)*400;
else
leap=(year/4)*4;
if (leap==year)
printf("\n%d is a leap year.",year);
else
printf("\n%d is not a leap year.",year);
printf("\n\n\n\n\n\t\t\tHAVE A NICE DAY! BYE.");
getch();
}
C Source Codes List | Source Code Home
|
|