Area of largest semicircle that can be drawn inside a square | C ++ program to find Area of semicircle in a square ; Function to find area of semicircle ; Driver code ; side of a square ; Call Function to find the area of semicircle
#include <bits/stdc++.h> NEW_LINE using namespace std ; float find_Area ( float a ) { float R = a * ( 2.0 - sqrt ( 2 ) ) ; float area = 3.14 * R * R / 2.0 ; return area ; } int main ( ) { float a = 4 ; cout << " ▁ Area ▁ of ▁ semicircle ▁ = ▁ " << find_Area ( a ) ; return 0 ; }