C Program to Check Given Year is Leap Year or Not

C Program to Check Given Year is Leap Year or Not

Write C Program to Check Given Year is Leap Year or Not

//WAP to check whether the given program is leap year or not

#include<stdio.h>

int main()
{
	int year;

	printf("Enter the year :--> ");
	scanf("%d", &year);

	if(year % 4 == 0)  //if the remainder becomes zero then leap year
	{
		printf("The entered year is leap year ");
	}
	else
	{
		printf("The entered year is not a leap year ");
	}

	return 0;
}

Output:

Run 1:
Enter the year :--> 1996
The Entered year is leap year

Run 2:
Enter the year :--> 2022
The entered year is not a leap year