http://prntscr.com/bj0gj0 How do I calculate the remaining minutes?
@SalazarBlack
Well, after you got your input, you minus the seconds of day, save the number of days that fit in, then do the same with hours and minutes. So, the procedure would go like this: 90061 seconds - 90061 when divided by 86400 is 1, so 90061 - 1 * 86400 = 3661; 3661 when divided by 3600 is 1, so 3661 - 1 * 3600 = 61; 61 when divided by 60 is 1, so 61 - 60 = 1; We get 1 day, 1 hour, 1 minute, 1 second. You could do this with if statements, if it is a programing question.
what ^ said
days=seconds/86400 hours=seconds/3600 minutes=seconds/60 I have my mathematical setup for these. I'm using a high-language level program called code::blocks; it's C++. I jut don't know how to find the remaining minutes, but you don't need to know about programming to tell me how to find it haha. @Zyberg
remaining seconds*
Well, I am familiar with c++ myself. I think it would be easier to change your formulas a little bit, but if you are okay with them, then that's no problem. secondsRemaining = input - days *86400 - hours*3600 - minutes*60
That said, you would need to write this after you declared days, hours, and minutes.
Really? How would you write the formula? Also, thanks for helping!
I wouldn't change much of it, but it might be nice to alter input after each procedure. Although that could lead to errors, so I doubt that my solution would be all that good. days = input/86400; input -= days; In this way you wouldn't need to count remaining seconds separately, but as I said - it might be not that good to use my suggestion. Just be aware that there are many ways to solve one problem. ;)
Join our real-time social learning platform and learn together with your friends!