You are provided with the radius of a
circle "A". Find the length of its circumference.
Note: In case the output
is coming in decimal, roundoff to 2nd decimal place. In case the
input is a negative number, print "Error".
function coc()
{var r=document.getElementById("num1").value;
var pi=3.1415;
var Circumference=(2*pi*r);
if (r>=0)
console.log(Circumference);
else
console.log("Error")}
Comments
Post a Comment