Question: Write a C program that: 1. Has three int pointers ptrHours, ptrMinutes, and ptrSeconds 2. Allocate memory to each pointer 3. Has an int variable
Write a C program that: 1. Has three int pointers ptrHours, ptrMinutes, and ptrSeconds 2. Allocate memory to each pointer 3. Has an int variable named inSeconds 4. Ask the user for the number of seconds s. Read in the number of seconds into the variable inSeconds 6. Call the function convertTime Write a C function named convertTime that will 1. convert a time given in seconds, to the hours, minutes, and seconds represented by that time (in seconds) 2. accept an int (number of seconds) a given the number of seconds, the function will calculate the number of hours, minutes and seconds represented by the number of seconds given to the function 4. The function changes the values of the three variables pointed to by the pointers ptrHours, ptrMinutes, and ptrSeconds that are in main. Therefore you will have to pass these three pointers to the function as well as the number of seconds void convertTime(int seconds, int*, int*, int*) in main 1. ask for the seconds 2. read in the seconds a call your function . the output should look like ??? seconds Converts to ??? hours ??? minutes ??? seconds
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
