Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int seconds;
- int minutes;
- int hours;
- int days;
- seconds = scanner.nextInt();
- if (seconds >= 86400)
- {
- days = seconds / 86400;
- System.out.println("Number of days in that many seconds " + days);
- }
- else if (seconds >= 3600)
- {
- hours = seconds / 3600;
- System.out.println("Number of hours in that many seconds: " + hours);
- }
- else if (seconds >= 60) {
- minutes = seconds / 60;
- System.out.println("Number of minutes in that many seconds: " + minutes);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement