C Program To Check Whether Year is Leap or Not

PROGRAM :

#include<stdio.h>
int main()
{
    int a;
    printf("Enter any Year \n");
    scanf("%d",&a);
    if(a%4==0)
    {
        printf("\n%d is a leap year \n",a);
    }
    else 
    {
        printf("\n%d is not a leap year\n",a);
    }
}




OUTPUT :

Enter any year
2021

2021 is not a leap year

Post a Comment

0 Comments