+ 2
Print the date in different format
Input a date and print it in the following format for example - Input-12 5 2014 Output - 12th,May,2014 Bonus : check if the other user entered a valid date beforehand For example : 12 5 2015(valid) 30 2 2013(invalid) 28 2 2017(valid) 29 2 2012(valid) 29 2 2013(invalid) 21 35 2015(invalid) 0 2 2014(invalid)
3 Antworten
+ 3
Hmm, I see this needs some work with ifs and elses
+ 3
Here you go. Checks for valid date input. Accounts for leap years.
https://code.sololearn.com/cGhUEwvBgHL7/?ref=app
+ 1
Hint: use arrays (one use would be storing max number of days in each month in array )