1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
fiasKO [112]
4 years ago
10

In this program you will read in the number of seconds and convert it to days, hours, minutes and remaining seconds. Your progra

m will make use of long long int variables for all calculations. Note: the use of long long int requires that you have C++11 support. You should have this automatically if you are using a newer version of Visual Studio. The support is there for GCC as well, but you may need the -std=c++11 or -std=c++0x compiler flag.
Computers and Technology
1 answer:
mart [117]4 years ago
3 0

Answer:

// here is code in c++.

// include headers

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variables

long long int inp_sec,days,hours,minutes,sec;

long long int s;

cout<<"please enter the seconds:";

 // read the input seconds

cin>>inp_sec;

 // make copy of input second

s=inp_sec;

 // compute days,86400 seconds in a day

days=inp_sec/86400;

 // update the seconds after counting days

inp_sec=inp_sec%86400;

 // compute hours, 3600 seconds in an hour

hours=inp_sec/3600;

 // update the seconds after counting hours

inp_sec=inp_sec%3600;

 //compute minutes, 60 seconds in a minute

minutes=inp_sec/60;

 // compute remaining seconds

sec=inp_sec%60;

 // print the output

cout<<s<<" seconds is equal to "<<days<<" days "<<hours<<" hours "<<minutes<<" minutes "<<sec<<" seconds "<<endl;

return 0;

}

Explanation:

Declare variables "inp_sec","days","hours","minutes" and "sec" of long long int type. read the seconds from user and assign it to variable "inp_sec".Make a copy of input  seconds.Then compute the days by dividing inp_sec with 86400 and update the inp_sec. then find hours by dividing inp_sec with 3600 and update the inp_sec.Similarly  find the minutes and remaining seconds.After this print the output.

Output:

please enter the seconds:83647362                                                                                                                            

83647362 seconds is equal to 968 days 3 hours 22 minutes 42 seconds

You might be interested in
How many electrons are there in an atom of carbon? A. Four B. Eight C. Six D. One
DochEvi [55]
It's has six electrons because of it's atomic number
5 0
4 years ago
Read 2 more answers
This career involves answering questions about computer parts and trouble shooting broken computers? Video game designer, comput
adelina 88 [10]

Computer retail sales associate is my best guess. :)

3 0
3 years ago
A user logging on, an application server connecting to a database server, an authentication server rejecting a password, or an a
ser-zykov [4K]
<span>The answer is Event.  A user logging on, an application server connecting to a database server, an authentication server rejecting a password, or an antivirus scanner reporting a suspected virus are all examples of Event.
</span>
4 0
4 years ago
It is important to avoid using a person’s title in an email to avoid offending him or her.
Nataly [62]

The answer to this is FALSE. I just took the test & got 100%.

3 0
4 years ago
Read 2 more answers
In ancient times what did kings and tribals chiefs use to communicate
mel-nik [20]

Answer:

they used sign language to communicate and also pegion was used to communicate

8 0
3 years ago
Other questions:
  • Complete each statement by choosing the correct answer from the drop-down menu.
    10·1 answer
  • Most OEMs recommend that the engine oil be replaced and a new filter installed at which of the following mileage intervals ?
    7·1 answer
  • Discuss OPENGL instruction to draw the following drawing primatives:
    14·1 answer
  • Name one advantage of modular switches over fixed-configuration switches.
    5·1 answer
  • Long-tail keywords are:
    9·1 answer
  • Andrew works for a company that develops for a company that develops optic-fiber cables for transmission of data. which layer of
    14·1 answer
  • Describe the steps which should be taken after a cyber-attack has taken place
    7·1 answer
  • Hey does anyone know the name of that movie where like this teenage girl is chilling at her house then there is an outbreak of s
    6·1 answer
  • Which memory can be removed from motherboard? RAM OR ROM?​
    7·1 answer
  • What are the common operations performed on character strings?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!