0

Below code is correct or wrong plz tell me ?

import java.util.Scanner; public class Program { public static void main(String[] args) { int days,hours,minutes,seconds; Scanner scanner = new Scanner(System.in); System.out.println(" days are"); days = scanner.nextInt(); hours= days*24; System.out.println(hours+"hours"); System.out.println("which are hours"); hours = scanner.nextInt(); minutes=hours*60; System.out.println(minutes+ "minutes"); System.out.println("which are minutes" ); minutes= scanner.nextInt(); seconds = minutes*60; System.out.println( seconds+ "seconds" ); } }

21st Nov 2021, 4:53 AM
Aditya Prabhu
Aditya Prabhu - avatar
4 odpowiedzi
0
There not problem. All work correct. Yourself code need send on code in sololearn, but not in topic.
21st Nov 2021, 4:28 PM
BoikoMaxim2005
+ 2
This code compile and run properly other online compiler but if run solorun is not working
21st Nov 2021, 5:47 AM
Aditya Prabhu
Aditya Prabhu - avatar
+ 1
What do you mean? Run it yourself. If it runs then it means that it doesn't have any errors. Also, without the question how to see if your answer is right or wrong?
21st Nov 2021, 5:29 AM
Rishi
Rishi - avatar
+ 1
Aditya Prabhu Sololearn supports inputs only once means you have to take all inputs together with new line like: 30 24 60
21st Nov 2021, 7:17 AM
A͢J
A͢J - avatar