Computer Science, asked by mohittnarwall308, 7 hours ago

write a program intput the time in second display the time after conveting them into hours minute and second use buffer reader​

Answers

Answered by dxb4741421
2

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");

   }

}

its in java

is it helpful?

Similar questions