Monday, 19 September 2011

Program of leap year in C

LEAP YEAR
list of leap years(1804,1808,1812..... and so on..)
list of non leap years(1700,1800,1900,2100....)
#include<stdio.h>
#include<conio.h>
void main()
{
int y;
clrscr();
printf("Enter the year: ");
scanf("%d",&y);
if((y%4==0 && y%100!=0) || (y%400==0))
printf("Leap year..");
else
printf("Not a leap year...");
getch();
}
Run this program and if you have any problem in understanding the concept then do comment.

No comments:

Post a Comment