/* program to find whether a year is leap or not */
#include<stdio.h>
#include<conio.h>
void main()
{
int year;
printf("Enter year :");
scanf("%d",&year);
if(year%100==0)
{
if(year%400==0)
printf("Leap year \n");
else
printf("Not leap year \n");
}
else
{
if(year%4==0)
printf("Leap year \n");
else
printf("Not leap year \n");
}
getch();
}
No comments:
Post a Comment