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