- 6

In java how can I convert 12 days into seconds

Any solution?

21st Feb 2021, 4:56 PM
Samarth Kulshreshtha
Samarth Kulshreshtha - avatar
17 Respuestas
+ 2
int day =12, int h= 24, int min = 60, int sec =60 int dayTOsecond =day*h*min*sec System. out. println(dayTOsecond) Dont forget. ;
21st Feb 2021, 7:25 PM
Qutaba Qais Mahmood
Qutaba Qais  Mahmood - avatar
+ 2
int day =12; int h= 24; int min = 60; int sec =60; int dayTOsecond =day*h*min*sec System. out. println(dayTOsecond);
21st Feb 2021, 7:29 PM
Qutaba Qais Mahmood
Qutaba Qais  Mahmood - avatar
+ 1
you can do it yourself ^^
21st Feb 2021, 4:59 PM
visph
visph - avatar
0
12(days)*24(hours)*60(minutes)*60(seconds)
21st Feb 2021, 4:58 PM
visph
visph - avatar
0
Yes but I want full coding
21st Feb 2021, 4:59 PM
Samarth Kulshreshtha
Samarth Kulshreshtha - avatar
0
But why my result comes no output
21st Feb 2021, 5:00 PM
Samarth Kulshreshtha
Samarth Kulshreshtha - avatar
0
did you print your result?
21st Feb 2021, 5:01 PM
visph
visph - avatar
0
Print.ln ,yes
21st Feb 2021, 5:01 PM
Samarth Kulshreshtha
Samarth Kulshreshtha - avatar
0
share your code to get more help ^^
21st Feb 2021, 5:02 PM
visph
visph - avatar
0
Yes but don't laugh at my first problem
21st Feb 2021, 5:03 PM
Samarth Kulshreshtha
Samarth Kulshreshtha - avatar
0
Wait wait wait how to share I am a newbie
21st Feb 2021, 5:04 PM
Samarth Kulshreshtha
Samarth Kulshreshtha - avatar
0
make your code playground public click the share icon (3 linked dots), choose to copy to clipboard and then paste here... or click the plus (+) icon in post textarea, choose insert code, and select your code (there is a menu where you could choose to display only yours)
21st Feb 2021, 5:08 PM
visph
visph - avatar
0
class my class { public static void main {(String [] arg) int x = 12 int y = 24 System.out.println (x*y) } }
21st Feb 2021, 5:13 PM
Samarth Kulshreshtha
Samarth Kulshreshtha - avatar
0
you're missing at least one opening curly bracket '{' after main function argument list ;)
21st Feb 2021, 5:15 PM
visph
visph - avatar
0
See this one that I corrected is it now ok
21st Feb 2021, 5:16 PM
Samarth Kulshreshtha
Samarth Kulshreshtha - avatar
0
you must also name your class with a valid identifier (no spaces) and end your lines with semi-colon ';' https://code.sololearn.com/ceRczYLJcGaI/?ref=app also I have added some indentation...
21st Feb 2021, 5:21 PM
visph
visph - avatar
0
Thanks sir, can you clear my doubts if free?? Sir please..
21st Feb 2021, 5:24 PM
Samarth Kulshreshtha
Samarth Kulshreshtha - avatar