C program to check valid date (date is valid or not)

check date validity

There are a lot of people who don’t know how to check valid date and make mistakes at the time of creation of the date. In this article, I will describe the way to how to create and check the validity of the date.

Whenever you require to create a date manually then you should care about the following points.

  • Year, months and days range.
  • Leap Year.
  • Months that have 30 days
  • Months that have 31 days


If you want to learn more about the c language, here 10 Free days C video course for you.

C tutorial


In below program, I am reading the user entered data and create date in dd/mm/yyyy format. Before creating the date I will verify the user entered data.

  • I am following the below steps to accomplish the program.
  • First checking range of the years, months and days.
  • Handle the leap year (day of Feb months).
  • Handle the months which has 30 days.

See below program to check valid date:

check valid date

check valid date

Leave a Reply