Answer the question
In order to leave comments, you need to log in
Present code in Node?
I solved the problem (calculate the area of an inscribed circle). Got this code
var a = 6;
var b = 8;
console.log((3.14 * Math.pow((a + b - (Math.sqrt(Math.pow(a,2) +Math.pow(b,2) ).toFixed(2)))/2,2)).toFixed(2));
Answer the question
In order to leave comments, you need to log in
And why didn't you turn to the documentation ? - it would immediately become clear that the passed arguments begin with an index equal to 2. And not 1.
And of course, you forgot that the command line arguments are of type string, and you use them as numbers - the result will be completely different from you expect. We have to transform.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question