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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started