Computer Science, asked by nityaagarwal2007, 1 month ago

write a program to input the time in second display the time after converting it into hour,minutes and secs input:time in second 5420
output:time in 1 hour 30 min 20 secs
help this is very urgent​

Answers

Answered by kamalrajatjoshi94
2

Answer:

Program:-

import java.util.*;

public class Main

{

public static void main(String args[])

{

Scanner in=new Scanner(System.in);

int sec=0,s,hr,m,r,t;

System.out.println("Enter the time in seconds");

s=in.nextInt();

hr=s/3600;

m=(s%3600)/60;

sec=(s%3600)%60;

System.out.println("Time= " + hr+ " hour " + m+" minutes "+ sec+" seconds");

in.close();

}

}

Attachments:
Similar questions