+ 1
Algorithm
https://code.sololearn.com/cWPM2El9J6u7/?ref=app This is my code. Iâm trying to make it so that it checks if the number entered is a perfect square. If it is, it gives the square root but if not it say that itâs not a perfect square. Is there a simple way of doing this?
6 Answers
0
Here you go man https://code.sololearn.com/WqKeqDkf1u6Q/?ref=app
+ 4
John Lebo actually you mean JavaScript and you entered JavaScript functions, but you executed in Java
just go to web and start coding in JavaScript section
Note1 : java and JavaScript are different programming languages.
Note2 : you did not mentioned + operator after x in if condition 3th line.
here's the example:
https://code.sololearn.com/WxRe53VrvB51/?ref=app
+ 3
0
Dâlite
not what I meant but thanks
0
https://code.sololearn.com/W0S6GFCUeAn1/?ref=app
hereâs the code in javascript
0
what i want is for a prompt to pull up asking to type in a number, have it calculate if its a perfect square, it gives the square root if its a perfect square, say its not a perfect square if it isnt, in alerts