C Program to Check the Leap Year

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

OUTPUT:

EX 1:

Enter Year : 2000
2000 is a Leap Year

EX 2:

Enter Year : 2004
2004 is a Leap Year

Leave a Reply

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