by manojthesingham » Tue Sep 01, 2009 6:25 am
/*
Is 1100 is leap year or not ==> 1100 is not leap year
Earth Revolves around the Sun at 365.26 days
that 0.26 days are compensated as leap years
*/
#include<stdio.h>
#include<conio.h>
typedef enum{false=0,true=1}boolean;
boolean leap_year(int x)
{
if((x%400)==0)
return true;
if((x%100)==0)
return false;
if((x%4)==0)
return true;
return false;
}
int main(int argc,char **argv)
{
int x;
printf("Enter the year to check whther it is leap year or not : ");
scanf("%d",&x);
printf("%s",leap_year(x)?"LEAP Year":"Not A LEAP Year");
getch();
return 0;
}
If world is running, then I am idle..
If I am idle, then the world is running