Home
User Guide
DB Recovery
Download
Documents
FAQ
Books
About Me
C Programs
Stats

/* 
   Program# 14 
   date : 25-12-2008
   Leap Year or not
*/

#include <stdio.h>
main(){
int n,x;
printf("\nEnter a year : ");
scanf("%d",&n);
x=n%4; // year which is divisible by 4 is said to be a leap year except the centuries like 400, 1200, 1600, 2000 etc..
if(x==0)
printf("\n%d : Leap year\n",n);
else
printf("\n%d : Ordinary year\n",n);
}

output:
Enter a year : 2008
2008 : Leap year


Powered by
Open Source Programmers