write a program in java that takes seconds as input and converts them into corresponding numbers of hours please answer?
Answers
Answered by
1
Code :
import java.util.Scanner;
public class myclass {
public static void main () {
float seconds, hours;
Scanner scan = new Scanner(System.in);
seconds = scan.nextInt();
// 1 hour = 3600 seconds
hours = seconds/3600;
System.out.printf("%f", hours);
}
}
Similar questions