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