Write a java program to accept seconds as an input and convert into hours and minutes?
import java.util.*;
public class timeConvert {
int sec=0,min=0,hr=0;
int reminder=0;
Scanner sr = new Scanner(System.in);
public timeConvert(){
System.out.println(“Enter seconds to convert”);
sec=sr.nextInt();
if(sec!=0){
min=sec/60;
reminder=sec%60;
sec=reminder;
if(min>=60){
hr=min/60;
min=min%60;
}
}
System.out.println(hr+”Hours:”+min+”Minutes:”+sec+”Seconds”);
}
public static void main(String args[]){
timeConvert tc = new timeConvert();
tc.getClass();
}
}