C program to print whether a year is leap or not

C program to print whether a year is leap or not. This program will print the leap year or not program in C program. How to check the year is leap year or not program in c language. This will check the year leap or not by %4 with the year.

#include <stdio.h>
int main() 
{
int year;
printf("Enter the year");
scanf("%d", &year);
if (year % 400 == 0) 
{
printf("%d is a leap year", year);
}
else if (year % 100 == 0) 
{
printf("%d is not leap year", year);
}
else if (year % 4 == 0)
{
printf("%d is a leap year", year);
}
else
{
printf("%d is not leap year", year);
}
return 0;
}

Output

Enter the year

2020

2020 is a leap year