write a program in bluej { java } to input time in hour , minute and seconds format and convert it into total number of seconds.
Answers
Answered by
3
Here is the ans hope it's helpful for you☺
import java.util.*;
public class Exercise55 {
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.print("Input seconds: ");
int seconds = in.nextInt();
int p1 = seconds % 60;
int p2 = seconds / 60;
int p3 = p2 % 60;
p2 = p2 / 60;
System.out.print( p2 + ":" + p3 + ":" + p1);
System.out.print("\n");
}
}
#its Sayan✌
Similar questions
Computer Science,
27 days ago
English,
27 days ago
Hindi,
27 days ago
Math,
1 month ago
History,
9 months ago