Find the area of the shaded region formed by the intersection of four semicircles in a square | C ++ implementation of the approach ; Function to return the area of the shaded region ; Area of the square ; Area of the semicircle ; There are 4 semicircles shadedArea = Area of 4 semicircles - Area of square ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; float findAreaShaded ( float a ) { float sqArea = a * a ; float semiCircleArea = ( 3.14 * ( a * a ) / 8 ) ; float ShadedArea = 4 * semiCircleArea - sqArea ; return ShadedArea ; } int main ( ) { float a = 10 ; cout << findAreaShaded ( a ) ; return 0 ; }