Question: in c language. The template code defines a Time struct. Given main ( ) that reads two Times and computes the difference between the two,
in c language. The template code defines a Time struct. Given main that reads two Times and computes the difference between the two, complete the following two functions:
Time CreateTimeint hours, int minutes, int seconds
Allocate and return a new Time according to the parameters
Time TimeDifferenceTime end, Time start
Allocate a new Time to store the computed time difference
Compute the amount of time elapsed from start to end. Assume start is always before end.
Adjust for negative minutes and seconds.
Return the pointer to Time that contains the difference
main calls ReadTime to read input from a user and uses the input to create a new Time by calling CreateTime PrintTime is provided to output Time in hour format hh:mm:ss
Ex: If the input is:
the output is:
Start: ::
End: ::
Difference: ::
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
