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

Stop Chasing People Who Don't Match Your Effort ❤️ | A Life Lesson

Right. [clears throat] So yeah, it's 12 a.m. in the night and I have been done with my work uh from everything and I wanted to share an ...