Monday, August 23, 2010

TO FIND LEAP YEAR

0 comments
/*To find leap year from a set of years*/
#include<stdio.h>
#include<conio.h>
void main()
{
int year[10],i;
clrscr();
printf("Enter up to 10 years:\n");
for(i=0;i<10;i++)
scanf("%d",&year[i]);
for(i=0;i<10;i++)
{
if((year[i]%4==0 && year[i]%100!=0)||(year[i]%400==0))
printf("\n%d Year is a leap year",year[i]);
else
printf("\n%d Year is not leap year",year[i]);
}
getch();


NOTE:Copy and past the source code into your c compiler
Continue reading →