by Dinesh Thakur Category: C Programming (Pratical)

A year is leap if it is divisible by 4 but not by 100 or is divisible by 400. Thus, 1996, 2000 and 2004 are leap years but 1900, 2002 and 2100 are not. The program segment given below determines whether a given year (of type int) is leap or not.

void main()
       int year;
       printf("Enter a Year : ");
              printf("Leap Year");
              printf("Not a Leap Year");
Output :
Enter a Year : 2013
Not a Leap Year

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.