Computer Science, asked by sudhiratram3911, 9 months ago


Write a Javascript program which find the area of Circle.

Answers

Answered by AskewTronics
2

Below are the output and the JavaScript program for the above question

Output :

If the user input as 1, then it will print as "3.142857142857143".

If the user input as 2, then it will print as "12.571428571428571".

Explanation:

var value=parseInt(prompt("Enter the number to fild the area of a circle"));// take the input from the user

document.write("The area of a circle is "+(22/7)*value*value)//print the value of area.

Code Explanation :

  • The above code is in JavaScript language which has the one input function which opens the dialog box and takes input and then calculates the area of a circle with the help of formula.
  • When the user wants to run the above program, then he needs to add this program on the HTML file or in any JavaScript editor.

Learn More :

  • JavaScript : brainly.in/question/9980021
Similar questions