Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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

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

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

1. Traditional and modern methods of preserving food Articles ?

Answered: 1 week ago

Question

What is sociology and its nature ?

Answered: 1 week ago

Question

What is liquidation ?

Answered: 1 week ago

Question

Explain the different types of Mergers.

Answered: 1 week ago

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago