text: Program to find the Perimeter of a Regular Polygon | C program to find the perimeter of a regular polygon ; Function to calculate the perimeter ; Calculate Perimeter ; driver code ; Get the number of sides ; Get the length of side ; find perimeter
code: #include <stdio.h> NEW_LINE float Perimeter ( float s , int n ) { float perimeter = 1 ; perimeter = n * s ; return perimeter ; } int main ( ) { int n = 5 ; float s = 2.5 , peri ; peri = Perimeter ( s , n ) ; printf ( " Perimeter ▁ of ▁ Regular ▁ Polygon STRNEWLINE " " ▁ with ▁ % d ▁ sides ▁ of ▁ length ▁ % f ▁ = ▁ % f STRNEWLINE " , n , s , peri ) ; return 0 ; }