WAP to input hours, minutes and seconds and display in seconds Java. program answer fast please
Answers
Answered by
0
Answer:
import java.util.Scanner; public class KboatTime { public static void main(String args[]) { Scanner in = new Scanner(System.in); System.out.print("Time in seconds: "); int inputTime = in.nextInt(); int hrs = inputTime / 3600; int mins = (inputTime % 3600) / 60; int secs = (inputTime % 3600) % 60; System.out.println(hrs + " Hours " + mins + " Minutes " + secs + " Seconds"); }
Similar questions
Environmental Sciences,
9 days ago
Hindi,
18 days ago
Math,
18 days ago
English,
9 months ago
Math,
9 months ago