Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions