I wanna convert a given amount of seconds into hours, minutes and seconds. I wanna use modulus to get the result I'm looking for. I KNOW that's it's easy but I'm stuck. How ever I turn it around I can't get it to work. Example... the time is 7500 sec. When I convert it I either get 1 hour 75 minutes and 0 sec. or I get 1 hour -4500 min and 0 sec.
This is the code I'm using
// Converting secs into minutes and hours, fastest_Time being // the incoming amount of seconds int out_Sek, out_Min, out_Hour; out_Sek = fastest_Time % 60; out_Min = ??????? // This is the part I'm having problem with out_Hour = fastest_Time /3600; cout << "Fastest time was: " << out_Hour << " hours "<< out_Min<< " min. "<< ut_Sek << " sek. ";