Hello Professor, I am constantly getting the wrong answer despite getting the right output. Could you please tell me where I am going wrong?
public class Main {
public static void main(String[] args) {
int a = 2015;
int seconds = a % 60;
int hours = a / 60;
int minutes = hours % 60;
hours = hours / 60;
System.out.println(hours + " " + minutes + " " + seconds);
}
}
Another method that I used was:
public class Main {
public static void main(String[] args) {
int a = 2015;
int b = a / 3600;
int c = a / 60;
int d = a % 60;
System.out.println(b + " " + c + " " + d);
}
}