C++ Examples – C++ Program to Check Leap Year

In the Julian Calendar, Leap Year (LY) occurs every year divisible by 4. Normally February has 28 days but in a leap year February has 29 days.

In this lesson we will learn how to write a C++ program to check if the giver year is leap year or not.

After you write a C++ program you compile it; that is, you run a program called compiler that checks whether the program follows the C++ syntax

  • if it finds errors, it lists them
  • If there are no errors, it translates the C++ program into a program in machine language which you can execute



Partner Sites




  • disqus_7zHMuBkv1k

    2000 was a leap year. Since 1752, in this country, years exactly divisible by 100 are only leap years when they are also exactly divisible by 400. So 1800 and 1900 were not leap years, neither will 2100 or 2200 be leap years.