0
Please guys i am stuck at the time converter question. I have tried my best i didn't get it.
You need a program to convert days to seconds. The given code takes the amount of days as input. Complete the code to convert it to seconds and output the result. Sample Input: 12 Sample Output: 1036800
2 Answers
+ 2
I'm coming from Javascript World
const days=12;
let secs=days*86400;
// 1 day = 86400 seconds
console.log(secs);
+ 2
Hi Sorefunmi Aina-Badejo,
Here is my solution, but please tell us, where you're stuck.
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int days = scanner.nextInt();
//your code goes here
int seconds;
seconds = days * 86400;
System.out.println(seconds);
}
}