#include<stdio.h>
#include<conio.h>
void main()
{
int year;
clrscr();
printf("\n Enter the year");
scanf("%d",&year);
if (year%100==0)
{
if(year%400==0)
printf("\n Year %d is leap",year);
else
printf("\n Year %d is not leap", year);
}
else
{
if(year%4==0)
printf("\n Year %d is leap",year);
else
printf("\n Year %d is not leap", year);
}
getch();
}
#include<conio.h>
void main()
{
int year;
clrscr();
printf("\n Enter the year");
scanf("%d",&year);
if (year%100==0)
{
if(year%400==0)
printf("\n Year %d is leap",year);
else
printf("\n Year %d is not leap", year);
}
else
{
if(year%4==0)
printf("\n Year %d is leap",year);
else
printf("\n Year %d is not leap", year);
}
getch();
}
No comments:
Post a Comment