Oh. Those sites are horrible.
Printable View
do you know how to get the output as when i input 1000
Enter a number of seconds:
There are 16.667 minutes in 1000.000 seconds.
my output would say
Enter a number of seconds:
There are 16.666667 minutes in 1000.000000 seconds.
There are 0.277778 hours in 1000.000000 seconds.
There are 0.011574 days in 1000.000000 seconds.
what code would make it have 2 lines instead of 3?
Code:#include <iostream>
using namespace std;
int main() {
double input,days,hours,minutes,seconds;
cout << "Enter a number of seconds: ";
cin >> input;
seconds = input;
minutes = seconds / 60;
hours = minutes / 60;
days = hours / 24;
cout <<endl << "There are " << minutes << " minutes in " << seconds << " seconds" <<endl;
cout << "There are " << hours << " hours in " << seconds << " seconds" <<endl;
cout << "There are " << days << " days in " << seconds << " seconds" <<endl;
return 0;
}