C program to check Leap Year

Below is C program to check Leap Year.

Program:

/* Check Leap Year */
#include<stdio.h>
int main()
{
    int y;
    printf("Enter a year: ");
    scanf("%d",&y);
    if(y%4==0)
        printf("Leap Year");
    else
        printf("Not a Leap Year");
   return 0;
}

No comments:

Post a Comment