Hi, how to make a time converter ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hi, how to make a time converter ?

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 } }

21st Nov 2022, 2:33 PM
Hus Sam
Hus Sam - avatar
3 Answers
+ 1
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int days = scanner.nextInt(); System.out.println(days*24*60*60); } }
21st Nov 2022, 2:44 PM
Sakshi
Sakshi - avatar
+ 2
A day = 24 hours 1 hour = 60 minutes 1 minute = 60 seconds ; Found logic...?
21st Nov 2022, 2:41 PM
Jayakrishna 🇮🇳
+ 1
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 System.out.println(days*24*60*60); } }
21st Nov 2022, 2:57 PM
Achyuta Shrimate
Achyuta Shrimate - avatar