Advertisement
Guest User

hour/min/sec calc

a guest
Sep 27th, 2016
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.28 KB | None | 0 0
  1. int inputSecs = 6400;
  2. int seconds = inputSeconds % 60;
  3. inputSecs -= seconds;
  4. int minutes = inputSecs/60;
  5. int remainderMins = minutes % 60;
  6. minutes -= remainderMinutes;
  7. hours = minutes % 60;
  8. Console.WriteLine(seconds);
  9. Console.WriteLine(remainderMins);
  10. Console.WriteLine(hours);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement