Write a C program to check Leap year or Not


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

Output 1:

Enter a year: 1997
1997 is not a leap year.

Output 2:

Enter a year: 2004
2004 is a leap year


Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top