First time here? Checkout the FAQ!
x
menu search
brightness_auto
more_vert

WAP to check if the entered year is leap year or not.

thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

1 Answer

more_vert
 
verified
Best answer
#include<stdio.h> 
int main() {
    int year;    
    printf("Enter a year: \n");
    scanf("%d", &year);
    if( (year % 4 == 0 && year % 100 != 0 ) || (year % 400 == 0) )
    {
        printf("%d is a leap year", year);
    }
    else
    {
        printf("%d is not a leap year", year);
    }
    return 0;
}

Run code

thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
...