check a year is Leap year or not in C

 #include<stdio.h>

int main()

{

int year;

printf("Enter the year\n");

scanf("%d", &year);

if (((year % 4 == 0) && (year % 100!= 0 )) || (year%400 == 0))

printf("This year is Leap year %d\n", year);


    else 

printf("This year is not Leap year %d\n", year);


    return 0;

}

Comments

Popular posts from this blog

create a num table in a new file in c

write a programme to compare time stamp in c

write a struct programme to keep bank details in c