C++ Program to Check Leap Year

This program will check the entered year by the user is a leap year or not. In this program, we have used the if…else statement to check the leap year.

Pseudo code to check leap year

  1. if year is divisible by 4 then is_leap_year
  2. else if year is divisible by 100 then not_leap_year
  3. else year is divisible by 400 then is_leap_year
  4. else not_leap_year

Copy the below program and execute it to check the leap year.

Example: how to check leap year using C++ program


#first try
Please enter a year in number: 2004
2004 is a leap year.
#second try
Please enter a year in number: 2006
2006 is a leap year.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Article Tags: , , , , ,