Thank you for visiting Write a program in C that asks the user to enter a number of seconds 3 a There are 86400 seconds in a day If. This page is designed to guide you through key points and clear explanations related to the topic at hand. We aim to make your learning experience smooth, insightful, and informative. Dive in and discover the answers you're looking for!

Write a program in C++ that asks the user to enter a number of seconds.

3.a There are 86400 seconds in a day. If the number of seconds entered by the user is greater than or equal to 86400, the program should display the number of days in that many seconds.

3.b There are 3600 seconds in an hour. If the number of seconds entered by the user is less than 86400 but is greater than or equal to 3600, the program should display the number of hours in that many seconds.

3.c There are 60 seconds in a minute. If the number of seconds entered by the user is less than 3600 but is greater than or equal to 60, the program should display the number of minutes in that many seconds.

Answer :

In this exercise we have to use the knowledge of C++ to write a program that is possible that asks the user to enter a number of seconds.

Writting the code:

#include

#include

using namespace std;

int main() {

int n;

cout<<"Time Calculator"<

cout<<"Enter the seconds you would like to calculate into days, hours, minutes: ";

cin>>n;

cout<

cout<<"\t"<<(n/(24*60*60))<<" day(s)"<

n = n % (24*60*60);

cout<<"\t"<<(n/(60*60))<<" hours(s)"<

n = n % (60*60);

cout<<"\t"<<(n/(60))<<" minutes(s)"<

n = n % (60);

cout<<"\t"<<(n)<<" seconds(s)"<

return 0;

}

See more about C++ at brainly.com/question/19705654

#SPJ1

Thank you for reading the article Write a program in C that asks the user to enter a number of seconds 3 a There are 86400 seconds in a day If. We hope the information provided is useful and helps you understand this topic better. Feel free to explore more helpful content on our website!

Rewritten by : Jeany