Sunday, October 25, 2009

13.PROGRAM To Check Whether The Given Year Is Leap Year or Not.

//WAP To Check Whether The Given Year Is Leap Year or Not.
#include
#include
void main()
{
int year;
clrscr();
printf("ENTER THE YEAR=");
scanf("%d",&year);
if((year%100)==0)
{ if((year%4)==0)
printf("ENTERED YEAR IS A LEAP YEAR");
else
printf("ENTERED YEAR IS NOT A LEAP YEAR");
}
else
{
if((year%4)==0)

printf("ENTERED YEAR IS A LEAP YEAR");
else
printf("ENTERED YEAR IS NOT A LEAP YEAR");
}
getch();
}

No comments:

Post a Comment

Programming the Whole World!