C Program to Check Year is Leap Year or Not

We all know a normal year has been given 365 days and a leap year 366 days. In leap years, February 29th is added as leap day, which doesn't exist in a normal year. A leap year is comes every 4 years

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

Output - Program to Check Leap Year

	Enter a year: 2021
	is not a leap year. 
Compile and Run Online