Computer Science, asked by muddamharshitha938, 18 days ago

WAP to input hours, minutes and seconds and display in seconds Java. program answer fast please​

Answers

Answered by oODivineGirlOo
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