Seconds To Hours Java

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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);
}
}
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); } }
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

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Hours: 6
Minutes: 30
Seconds: 56
Hours: 6 Minutes: 30 Seconds: 56
Hours: 6
Minutes: 30
Seconds: 56