class SecondsToHoursMinutes { public static void main(String[] args) { int totalSecs = 23456; int hours = totalSecs / 3600; int minutes = (totalSecs int seconds = totalSecs System.out.println("Hours: " + hours); System.out.println("Minutes: " + minutes); System.out.println("Seconds: " + seconds); } }
Output
Hours: 6 Minutes: 30 Seconds: 56