wax wap to input time in seconds and split it into hours minutes and seconds
Answers
Answered by
1
Program 2:
import java.io.*;
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter time in seconds: ");
int time = sc.nextInt();
System.out.println("days = "+(time/86400));
System.out.println("hours = "+((time%86400))/3600);
System.out.println("minutes = "+(((time%86400)%3600)/60));
}
}
Output:
Enter time in seconds:
313800
days = 3
hours = 15
minutes = 10
---Hope you got what you wanted ( mark as brainliest if you like my way of answering :) )
Similar questions