So I almost have this code correct but it's not giving me the correct output for some reason and I can't figure out why. This is what I have:
package edu.ilsu;
import java.util.Scanner;
/**
* @author Nick
*/
public class Seconds {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int hours, minutes, number_of_seconds, seconds;
System.out.print("50391");
number_of_seconds = in.nextInt();
hours=number_of_seconds-number_of_seconds%3600;
seconds=number_of_seconds%60;
minutes=(number_of_seconds-hours-seconds)/60;
hours=hours/3600;
System.out.println("hours: " + hours);
System.out.println("minutes: " + minutes);
System.out.println("seconds: " + seconds);
}
}
That is what I have so far but I need the output to be
Enter number of seconds: 50391 Hours: 13 Minutes: 59 Seconds 51