To calculate the area of a circle the formula pi r squared is-00647
This subjective question is related to the book/course vu cs403 Database Management Systems. It can also be found in vu cs403 Mid Term Solved Past Paper No. 5.
Question 1: To calculate the area of a circle the formula pi*r squared is used. How would you code it in JavaScript?
<script type="text/javascript">
var radius,area;
radius = 10;
area = Math.PI*Math.pow(radius,2);
document.write("Area of circle with radius 10 is " + area );
</script>
</html>
Answer:
<html><script type="text/javascript">
var radius,area;
radius = 10;
area = Math.PI*Math.pow(radius,2);
document.write("Area of circle with radius 10 is " + area );
</script>
</html>