Home » questions » write a c++ program to convert seconds to hours, minutes and sconds?

write a c++ program to convert seconds to hours, minutes and sconds?

2006-07-30 03:42:54, Category: Programming & Design

Answers

  1. tedjn

    On 2006-07-30 03:47:40


    Once again, this appears to be some sort of exercise problem. In any case, another nudge in the right direction. You know the number of seconds. Start by finding how many minutes there are. You can use modulus. Then find out how many seconds are left over using some simple arithmetic. That's the number of seconds. Then, use the number of minutes to do the same thing and find the number of hours (again using %).
  2. Jangid

    On 2006-07-30 04:33:25


    try to solve ur self hint 1 min = 60 seconds 1 hrs = 60 mins :) now try
  3. frime

    On 2006-07-30 04:03:18


    // start value int secs; // result int hours, minutes, seconds; hours = secs / 3600; secs -= hours * 3600; minutes = secs / 60; seconds = secs - minutes * 60;