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