Free help with homework

Why join Brainly?

  • ask questions about your assignment
  • get answers with explanations
  • find similar questions

Write a Program in JAVA

to convert seconds into corresponding number of hours, min and seconds.
For example: 7266 sec. = 2hrs, 1min, 6sec.


The Brainliest Answer!
Class time
public static void main (int s)
int h=s/3600, x=s% 3600;
int m=x/60, ss=x% 60;
System.out.println (h+" Hours "+m+" Minutes "+ss+" Seconds ");
1 5 1
The Brain
  • The Brain
  • Helper
Not sure about the answer?
Learn more with Brainly!
Having trouble with your homework?
Get free help!
  • 80% of questions are answered in under 10 minutes
  • Answers come with explanations, so that you can learn
  • Answer quality is ensured by our experts