Valid Date Checker
PROValidation & ChecksDate Validation
Selection & Logic
Write a program that inputs a day, a month and a year (three integers, in that order) and outputs `Valid` if they form a real calendar date, otherwise `Invalid`.
Rules:
- The year must be 1 or greater and the month must be 1 to 12.
- The day must be at least 1 and no more than the number of days in that month.
- April, June, September and November have 30 days; February has 28 days, or 29 in a leap year; all other months have 31 days.
- A year is a leap year if it is divisible by 400, or divisible by 4 but not by 100.
For example, 29 2 2024 is `Valid` but 29 2 1900 is `Invalid`.
Example Input
29
2
2024
Example Output
Valid
0% (0 passed / 0 attempted)