loader image

C program to check leap year

Aim: Check whether a given year is a leap year or not using C.

#include<stdio.h>
#include<conio.h>
void main()
{
	int year;
	printf("Enter an year : ");
	scanf("%d",&year);
	if(year%4==0 && year%100!=0 || year%400==0)
	    printf("\n%d is a leap year",year);
	else
            printf("\n%d is not a leap year",year);
}
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Scroll to Top