+ 3

First code in JS. What is the code to get an output in console.log()?

The speed of sound in air is 343 meters per second. Create a program that takes the seconds as input, calculates and outputs to the console the distance the sound covers in a given number of seconds. Sample Input 3 Sample Output 1029 The total distance that sound covers in 3 seconds is 3*343 = 1029.

26th Oct 2020, 7:34 PM
Aang
Aang - avatar
2 Antworten
+ 6
https://code.sololearn.com/WSBQE9sn9UKw/?ref=app you can check above code with UI or in javascript you can use var sec=prompt("enter the number"); var distance=sec*343; console.log(distance);
27th Oct 2020, 2:16 AM
Mask Man(What's in a name?)
Mask Man(What's in a name?) - avatar
+ 2
Thank you very much!
27th Oct 2020, 2:17 AM
Aang
Aang - avatar