Pages

Saturday, 19 May 2012

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


32/*Write a program to input a Year and find out it is a Leep year or not*/

#include<stdio.h>
#include<conio.h>
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