Largest trapezoid that can be inscribed in a semicircle | C ++ Program to find the biggest trapezoid which can be inscribed within the semicircle ; Function to find the area of the biggest trapezoid ; the radius cannot be negative ; area of the trapezoid ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; float trapezoidarea ( float r ) { if ( r < 0 ) return -1 ; float a = ( 3 * sqrt ( 3 ) * pow ( r , 2 ) ) / 4 ; return a ; } int main ( ) { float r = 5 ; cout << trapezoidarea ( r ) << endl ; return 0 ; }