Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program with total time in seconds, input as a long long integer. Then output the number of years, months, days, hours, minutes, and
Write a program with total time in seconds, input as a long long integer. Then output the number of years, months, days, hours, minutes, and seconds. Use singular and plural names as appropriate, like 1 hour vs. 2 hours. You can assume the following: A year has 12 months A month has 30 days A day has 24 hours An hour has 60 minutes A minute has 60 seconds Ex: If the input is: 33786061 the output is: 1 Year 1 Month 1 Day 1 Hour 1 Minute 1 Second Ex: If the input is: 158123286 the output is: 5 Years 1 Month 3 Hours 8 Minutes 6 Seconds Ex: If the input is: 187488015 the output is 6 Years 10 Days 15 Seconds Your program must define and call the following function that receives as input the total amount and prints out each denomination of time. void PrintSeconds (long long int TotalSeconds) 301608.1764500 LAB ACTIVITY 16.35.1: Lab 5, P2(T): Convert seconds - functions 0/6 main.c Load default template... 1 #include 2 3/ Define your function here */ 4 5 int main(void) { 6 Your program must define and call the following function that receives as input the total amount and prints out each denomination of time. void Print Seconds (long long int TotalSeconds) 301608.1764500 LAB ACTIVITY 16.35.1: Lab 5, P2(T): Convert seconds - functions 0/6 main.c Load default template... 1 #include 2 3 /* Define your function here */ 4 5 int main(void) { 6 7 /* Type your code here. Your code must call the function. */ 8 9 return 0; 10 } 11 Develop mode Submit mode Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started