Monday, 24 May 2021

Write a C program to find whether a given year is a leap year or not

 Write a C program to find whether a given year is a leap year or not




#include 
#include 

int main()
{
    int year, a;
    printf("Enter a year to chack its leap year or not :");
    scanf("%d", &year);
    a = year % 4;
    if (a == 0)
    {
        printf("%d is leap year", year);
    }
    else
    {
        printf("%d is not leap year", year);
    }

    return 0;
}

Output:





Share:

Related Posts:

0 comments:

Post a Comment