write a program to input valid date and display next date.
Answers
Answered by
1
Answer:
Enter date.
Check year validation, if year is not valid print error.
If year is valid, check month validation (i.e. month is between 1 to 12), if month is not valid print error.
If month is valid, then finally check day validation with leap year condition, here we will day range from 1 to 30, 1 to 31, 1 to 28 and 1 to 29.
If day is valid print date is correct otherwise print error.
Similar questions