0
var n = prompt("Enter radius of circle (cm)", ""); var area = n * n * Math.PI; alert("Area of circle is " + area + " cm");
How do write cm^2 in javascript(on last line), please? I don't know. (I am not good at English)
3 Antworten
+ 2
alternate option
var n = prompt("Enter radius of circle (cm)", "");
var area = n * n * Math.PI;
var power="\u00B2";
alert("Area of circle is " + area + " cm"+power);
you have to use character code to show the specific character .
+ 1
I don't understand. I code on smart phone.
+ 1
Thank you verry much!