Sunday, October 25, 2020

C program to check whether the given year is a leap year or not

#include <stdio.h>

int main() {

    int y;

    printf("Enter a year:");

    scanf("%d",&y);

    if(y%4==0)

    {

        printf("%d is a leap year",y);

    }

    else

    {

        printf("%d is not a leap year",y);

    }

}

No comments:

Post a Comment

Struggling to Meditate? Try This Simple 1–100 Method (5 Minutes)

 Hi, so today we are going to discuss how to meditate easily in your daily life. Um, so it's like very simple but effective method that ...