Thread: stuck on this.

  1. #16
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Quote Originally Posted by typeqwerty View Post
    but when i run it on a site it where it automatically compile it would say i failed.
    Oh. Those sites are horrible.

  2. #17
    Registered User
    Join Date
    Sep 2012
    Posts
    8
    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?

  3. #18
    Registered User Eddie Ramos's Avatar
    Join Date
    Jan 2012
    Location
    CA
    Posts
    6
    Quote Originally Posted by typeqwerty View Post
    i need it to look like this. for example when i input 10000 it should say this as output. E


    Enter a number of seconds:
    There are 166.667 minutes in 10000.000 seconds.
    There are 2.778 hours in 10000.000 seconds.
    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;
    }
    Last edited by Eddie Ramos; 09-29-2012 at 05:55 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Just stuck indeed
    By TAboy24 in forum C++ Programming
    Replies: 3
    Last Post: 11-19-2007, 04:32 PM
  2. Stuck - Need a little help
    By nevek in forum C Programming
    Replies: 9
    Last Post: 06-11-2007, 03:57 PM
  3. A little stuck.. is this possible?
    By Ganoosh in forum C++ Programming
    Replies: 6
    Last Post: 07-20-2005, 03:06 PM
  4. Stuck with '\b'
    By pratip in forum C++ Programming
    Replies: 5
    Last Post: 10-28-2003, 07:49 AM
  5. Stuck again!
    By shewolf in forum C++ Programming
    Replies: 17
    Last Post: 10-23-2003, 12:27 PM