Military Time Problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Military Time Problem

My code works but it doesn't pass the whole way through the Military Time Problem https://code.sololearn.com/c5wVt3C5THUs/?ref=app

26th Apr 2023, 4:11 AM
Kayraze
Kayraze - avatar
3 Answers
+ 9
Kayraze , Don't post the code link in relevant tag... that space is for mentioning the language...and if you post the link there..it is not accessible... Put the link in description...
26th Apr 2023, 5:03 AM
Riya
Riya - avatar
+ 5
Kayraze You need to rethink the logic. Specially the block beginning with "if (strcmp(meridiem, "PM") == 0)".
26th Apr 2023, 9:03 AM
Emerson Prado
Emerson Prado - avatar
+ 3
Kayraze it needs more work. The first two tests that I tried with your code gave wrong answers. 1:30 PM came out 01:30 (should be 13:30) 12:30 PM came out 00:00 (should be 12:30)
26th Apr 2023, 7:48 AM
Brian
Brian - avatar