Saturday 10 December 2011

Write a program to input a Year and find out it is a Leep year or not in c

#include
#include
main()
{
int year;
clrscr();
printf("Enter The Year:");
scanf("%d",&year);
if((year%4==0)&&(year%100!=0)||(year%400==0))
{
printf("\n Year %d is A Leep Year",year);
}
else
{
printf("\n Year %d is Not A Leep Year",year);
}
getch();
}


OUTPUT
Enter The Year: 2004
Year 2004 is A Leep Year

No comments:

Post a Comment