#include<stdio.h>
int main()
{
int year;
printf(“Enter any year to check leap year\n”);
scanf(“%d”,&year);
if((year % 4 == 0) && (year % 100 != 0 || year % 400 == 0))
{
printf(“This is a leap year\n”);
}
else
{
printf(“This is not a leap year\n”);
}
return 0;
}
Output:
$ ./a.exe
Enter any year to check leap year
2015
This is not a leap year
$ ./a.exe
Enter any year to check leap year
2016
This is a leap year