+ 10

Challenge (6)

Make a program in HTML which can calculate cube root of a give number.

27th May 2017, 12:33 PM
Ekansh
35 Answers
+ 21
<script>for(;;){alert(Math.cbrt(prompt("Num")));}</script>
27th May 2017, 12:35 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 9
var a =parseInt(prompt("Enter")); var n = Math.pow(a, 1/3); alert (n)
27th May 2017, 12:58 PM
Kailash Loncha
Kailash Loncha - avatar
+ 9
@Terminator : not 1/4 ,it should be 1/3
27th May 2017, 12:59 PM
Nikhil
Nikhil - avatar
+ 9
https://code.sololearn.com/WGL8kl3B6vf2/?ref=app This Is My Code But Mark Nikhil's Answer as Best
27th May 2017, 1:02 PM
Kailash Loncha
Kailash Loncha - avatar
+ 9
Mark Nikhil's Answer as Best 😊
27th May 2017, 1:02 PM
Kailash Loncha
Kailash Loncha - avatar
+ 9
@Ekansh :- It was solved with the very first answer by ValentinHacker...There is a problem with your code playground i guess
27th May 2017, 1:25 PM
Nikhil
Nikhil - avatar
+ 9
Congratulations for badge
27th May 2017, 1:32 PM
Kailash Loncha
Kailash Loncha - avatar
+ 8
document.write(Math.pow(prompt("Number please"),1/3));
27th May 2017, 12:47 PM
Nikhil
Nikhil - avatar
+ 8
Ekansh :- What is the cube root of 27?
27th May 2017, 12:57 PM
Nikhil
Nikhil - avatar
+ 8
@Ekansh :- Write 27 in Valentin's and my code you will get 3
27th May 2017, 1:00 PM
Nikhil
Nikhil - avatar
+ 8
Let me try input tag
27th May 2017, 1:09 PM
Nikhil
Nikhil - avatar
+ 8
Its not public Now see
27th May 2017, 1:17 PM
Nikhil
Nikhil - avatar
+ 7
@ValentinHacker's code is also fully right..I think u should mark it best ..But Valentin after running your code nobody can go back from Code Playground ...Its like a death zone
27th May 2017, 12:52 PM
Nikhil
Nikhil - avatar
+ 7
Ekansh you got the answer to this?
27th May 2017, 1:59 PM
Nikhil
Nikhil - avatar
+ 6
Yes it is @Ekansh ...Copy it in JavaScript and then see
27th May 2017, 12:50 PM
Nikhil
Nikhil - avatar
+ 5
@nik 3
27th May 2017, 12:59 PM
Ekansh
+ 5
@Terminator it's not asking for no. please try it yourself
27th May 2017, 1:04 PM
Ekansh
+ 4
I want cube root not cube
27th May 2017, 12:38 PM
Ekansh
+ 4
@Nikhil code is not working
27th May 2017, 12:48 PM
Ekansh