JavaScript Program to Calculate Area of a Circle Using

Write a JavaScript program to calculate area of a circle using with statement.

Source Code

  <title> with statement example </title>
<script language="javascript" type="text/javascript">  
  var area, circumference;
  var r = 10;
  with (Math)
    area = PI * r * r;
    circumference = 2 * PI * r;
  with (document)
    write("Area of the Circle: " + area + "<br>");
    write("Circumference of the Circle: " + circumference);

"Coding Hub - Learn to code" app now available on Google Play Store