Question: Create a new program, add_hms12.c, that will extend your existing program to work with a 12 hour clock rather than a 24 hour clock. The

Create a new program, add_hms12.c, that will extend your existing program to work with a 12 hour clock rather than a 24 hour clock. The program will accept the initial times using a 24 hour clock, as before, but will print out the results using a 12 hour clock that appends AM or PM to the times.

Execution and Output Example (Multiple runs of the program):

Enter an initial 24-hour time as hours minutes and seconds: 7 30 50

Enter the time to add as hours minutes and seconds: 1 29 50

Total is 9:00:40 AM

Enter an initial 24-hour time as hours minutes and seconds 7 30 0

Enter the time to add as hours minutes and seconds: 5 0 0

Total is 12:30:00 PM

Enter an initial 24-hour time as hours minutes and seconds: 7 30 0

Enter the time to add as hours minutes and seconds: 25 30 0

Total is 9:00:00 AM tomorrow

Enter an initial 24-hour time as hours minutes and seconds 7 30 0

Enter the time to add as hours minutes and seconds: 49 30 0

Total is 9:00:00 AM in 2 days

please write the c program for this

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!