Program to find the Perimeter of a Regular Polygon | Function to calculate the perimeter ; Calculate Perimeter ; Get the number of sides ; Get the length of side ; find perimeter
function Perimeter ( s , n ) { var perimeter = 1 ; perimeter = n * s ; return perimeter ; } var n = 5 ; var s = 2.5 , peri ; peri = Perimeter ( s , n ) ; document . write ( " " + " " + n + " " + s . toFixed ( 6 ) + " " + peri . toFixed ( 6 ) ) ;