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