C program to find that entered year is leap year or not

A leap year is exactly divisible by 4 except for century years (years ending with 00). The century year is a leap year only if it is perfectly divisible by 400.

void main() 
int n; 
printf(“enter any year: ”);
if(n%4==0 && n%100 !=0 || n%400 ==0) 
printf(“year is a leap year”); 
else printf(“year is not a leap year”); 


enter any year: 1947 year is not a leap year

Leave a Reply