write JavaScript program to calculate area of circle
ANS:
<HTML>
<HEAD>
<TITLE>PROGRAM </TITLE>
</HEAD>
<BODY>
<h1> PROGRAM TO DISPLAY AREA OF CIRCLE
</h1> <br> <br>
Attachments:
Answers
Answered by
6
Here's the JavaScript program to calculate the area of a circle:
// Take user input to accept the value of radius of a circle from the user
var radius = parseFloat(prompt("Enter the radius: "));
// Print the area of a circle using the formula
// Area of circle = 22/7 * radius * radius
document.write("The area of a circle is " + (22/7) * radius * radius)
You can also add the above JavaScript program in HTML cōde.
Similar questions