EDIT: Not sure I got the question right...
Mine prints out the whole (integer) number of days, hours, minutes and seconds.
INPUT = 90
OUTPUT = 0 days, 0 hours, 1 minute and 30 seconds
Is that right?
Or do you want something more like;
INPUT = 90
OUTPUT = 0 days, 0 hours, and 1.5 minutes
double seconds = 0; //always init variables
//move these lines
cout <<"Enter a number of seconds: ";
cin >> seconds;
//validate input (ie what happens if the user enters -1000?)
//now these lines will work as 'seconds' has the correct value
double minutes = seconds /60;
double hours = minutes / 60;
double days = hours / 24;
You need to start with the biggest value first (ie DAYS) and work to the smaller numbers of seconds
This way it works for any number of seconds.
Note how we reduce the RemainingSeconds each time so that it holds the number of seconds left after we find the number of days, hours and minutes.
Also note how we keep the user inputed number of seconds (TotalSeconds) to display at the end of our calculations.
//get user to enter number of seconds
//collect this number in a variable (lets call it TotalSeconds)
//create a vaiable to hold the remaining seconds after we take off the days, hours and minutes (lets call it RemainingSeconds)
//RemainingSeconds = TotalSeconds
//if RemainingSeconds >= seconds in a day (86,400)
//NumDays is RemainingSeconds/ seconds in a day (86,400)
//find the remaining seconds (ie minus the seconds in the days from the user entered amount) RemainingSeconds = RemainingSeconds- (NumDays * seconds in a day (86,400) [this is where the MODULUS operator is handy]
//if RemainingSeconds >= seconds in an Hour (3,600)
//NumHours is RemainingSeconds / seconds in a hour
//find the remaining seconds RemainingSeconds = RemainingSeconds - (NumHours * seconds in a hour)
//etc for minutes
//print 'In [TotalSeconds] seconds there are [NumDays] days, [NumHours] hours, [NumMinutes] minutes and [RemainingSeconds] seconds'