A. The time in hours, minutes, and seconds is to be passed to a function named t
ID: 3634025 • Letter: A
Question
A. The time in hours, minutes, and seconds is to be passed to a function named tosec(). Write totsec() to accept these values, determine the total number of seconds in the passed data, and display the calculated value.B. Include the totsec() function written for part A., in a working program. The main() fucntion should correctly call totsec() and display the vale the function returns. Use the following test data to verify your program's operation: hours = 10, minutes = 36, and seconds = 54. Make sure to do a hand calculation to verify the result your program displays.
Explanation / Answer
#include int totsec(int hrs,int min,int secs) { return hrs*3600+min*60+secs; } int main() { int hrs=10,min=36,secs=54; printf(" number of secs is %d",totsec(10,36,54)); }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.