How to calculate the area of a circle in JavaScript

1 Answer

0 votes
const radius = 5.7;
 
const CircleArea = Math.PI * radius * radius;
 
console.log("The area of the circle is: " + CircleArea);

 
 
 
 
/*
run:
 
"The area of the circle is: 102.07034531513239"
 
*/

 



answered Sep 22, 2021 by avibootz
...