Program to find the Area and Perimeter of a Semicircle | Function for calculating the area ; Formula for finding the area ; Function for calculating the perimeter ; Formula for finding the perimeter ; Get the radius ; Find the area ; Find the perimeter
function area ( r ) { return ( ( 0.5 ) * ( 3.14 ) * ( r * r ) ) ; } function perimeter ( r ) { return ( ( 3.14 ) * ( r ) ) ; } var r = 10 ; document . write ( " " + area ( r ) . toFixed ( 6 ) + " " ) ; document . write ( " " + perimeter ( r ) . toFixed ( 6 ) + " " ) ;