I need to converted from seconds to hours, minutes and seconds.
(without using if)
and this is my code
import java.util.Scanner;
public class SecondToHoursAndMin {
public static void main (String[]ages)
{
Scanner in = new Scanner (System.in);
int second;
System.out.println("Enter the second: ");
second = in.nextInt();
int hours,minutes,second1;
hours=(second/3600);
minutes=(second%60);
second1=((second%60)%60);
System.out.println("The total of hours: "+hours);
System.out.println("The total of minutes: "+minutes);
System.out.println("The total of second: "+second1);
}
}