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

Output:

#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.

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: , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Solved Programs