Program to calculate the area between two Concentric Circles | Function to find nth concentric hexagon number ; Declare value of pi ; Calculate area of outer circle ; Calculate area of inner circle ; Difference in areas ; Driver code
function calculateArea ( x , y ) { var pi = 3.1415926536 ; var arx = pi * x * x ; var ary = pi * y * y ; return arx - ary ; } var x = 2 ; var y = 1 ; document . write ( calculateArea ( x , y ) ) ;