Question: Write a C program that accepts three integers as input (hour, minute, duration). Hour is in 24 hour format. The hour and minute should be

Write a C program that accepts three integers as input (hour, minute, duration). Hour is in 24 hour format. The hour and minute should be considered the start time, and duration should be in minutes. You should then calculate the end time and display it properly in the format ##:##.

Here is an example of running your program with two different inputs. NOTE: Bold text represents input that someone will type into your program.

Write a C program that accepts three integers as input (hour, minute,

First we read in the hour, then we read in the minute and then we read in the duration (which is in minutes). We then display the calculated end time formatted nicely like ##:## (look at the %d formatting options). Your program should be able to accept any time (in 24 hour format) and any duration. You code must make use of at least one if statement and one loop (for/while/do).

Starting Hour: 12 Starting Minute: 59 Starting Time is 12:59, what is the duration? 60 Ending Time is 13:59 Starting Time is 23:20, what is the duration? 130 Ending Time is 01:30

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!