Created
September 21, 2022 17:44
-
-
Save spukles/933ad26759c3b3c3c9626391d4a496fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class timecal { | |
//Main Method | |
public static void main(String[] args){ | |
//Create a Scanner Object | |
Scanner sc=new Scanner(System.in); | |
//Receive inputs | |
System.out.println("Enter Seconds: "); | |
//Compute int x1, x2, x3 | |
int sec=sc.nextInt(); | |
int x1=sec%60; | |
int x2=sec/60; | |
int x3=x2%60; | |
x2=x2/60; | |
//display result | |
System.out.println("HH:MM:SS- "+x2+":"+x3+":"+x1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment