7. Write a program to input the time in seconds. Display the time after converting
them into hours, minutes and seconds.Use buffered reader
Sample Input: Time in seconds 5420
Sample Output: 1 Hour 30 Minutes 20 Seconds
Answers
Answered by
0
Both programs are there
Answered by
1
Answer:
i forgot to write a program in java.
but i can help you with logic.
take input in seconds.
next, use a while loop,
divide the input number by 60.
capture the quotient and remainder in separate variables.
then after the while loop,
write a for loop with i value from 1 to 60, use if condition to check, if quotient or remainder is multiple of 60 and check with the value of i.
capture the values in separate variables for hours and minutes.
Similar questions