tierann3050
23.09.2019 •
Computers and Technology
Write a program that asks the user to enter a number of seconds. there are 60 seconds in a minute. if the number of seconds entered by the user is greater than or equal to 60, the program should display the number of minutes in that many seconds. there are 3,600 seconds in an hour. if the number of seconds entered by the user is greater than or equal to 3,600, the program should display the number of hours in that many seconds. there are 86,400 seconds in a day. if the number of seconds entered by the user is greater than or equal to 86,400, the program should display the number of days in that many seconds.
Solved
Show answers
More tips
- G Goods and services How to Make Soap at Home: Useful Tips for Beginners...
- C Computers and Internet How to Reinstall Windows: A Detailed Guide for Beginners...
- S Style and Beauty How to Get Rid of a Bruise: Tips and Tricks...
- F Food and Cooking Лечо: вкусное и простое блюдо для любой кухни...
- H Health and Medicine Relieving Swelling in Legs: Causes and Ways to Alleviate the Symptom...
Answers on questions: Computers and Technology
- C Computers and Technology 1. is often defined as using illicit (illegal) drugs, or when the drug is alcohol, tobacco, or a legitimate drug (prescription or over-the-counter), taking to much or using...
- M Mathematics Find the two values for 81 squared...
- M Mathematics What is £42 increased by 10%...
- E English Can u start a sentence with before...
- M Mathematics Can 21 over 42 be reduced...
- M Mathematics What is 3186 divided by 62...
- M Mathematics How to multiply 5/8 × 24...
- M Mathematics What is the estimate of 256+321...
- M Mathematics Describe 59 in two other ways...
- M Mathematics What is 5/7 times 8/9...
Ответ:
// here is code in c.
#include <stdio.h>
// main function
int main()
{
// variable to store seconds
long long int second;
printf("enter seconds:");
// read the seconds
scanf("%lld",&second);
// if seconds is in between 60 and 3600
if(second>=60&& second<3600)
{
// find the minutes
int min=second/60;
printf("there are %d minutes in %lld seconds.",min,second);
}
// if seconds is in between 3600 and 86400
else if(second>=3600&&second<86400)
{
// find the hours
int hours=second/3600;
printf("there are %d minutes in %lld seconds.",hours,second);
}
// if seconds is greater than 86400
else if(second>86400)
{
// find the days
int days=second/86400;
printf("there are %d minutes in %lld seconds.",days,second);
}
return 0;
}
Explanation:
Read the seconds from user.If the seconds is in between 60 and 3600 then find the minutes by dividing seconds with 60 and print it.If seconds if in between 3600 and 86400 then find the hours by dividing second with 3600 and print it. If the seconds is greater than 86400 then find the days by dividing it with 86400 and print it.
Output:
enter seconds:89
there are 1 minutes in 89 seconds.
enter seconds:890000
there are 10 days in 890000 seconds.
Ответ:
Finish to start
Explanation:
I looked it :) hoped it helped