Program to find the Area and Perimeter of a Semicircle | C ++ 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 ; driver code ; Get the radius ; Find the area ; Find the perimeter
#include <iostream> NEW_LINE using namespace std ; float area ( float r ) { return ( 0.5 ) * ( 3.14 ) * ( r * r ) ; } float perimeter ( float r ) { return ( 3.14 ) * ( r ) ; } int main ( ) { int r = 10 ; cout << " The ▁ Area ▁ of ▁ Semicircle : ▁ " << area ( r ) << endl ; cout << " The ▁ Perimeter ▁ of ▁ Semicircle : ▁ " << perimeter ( r ) << endl ; return 0 ; }