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
using System ; class GFG { static float trapezoidarea ( float r ) { if ( r < 0 ) return - 1 ; float a = ( 3 * ( float ) Math . Sqrt ( 3 ) * ( float ) Math . Pow ( r , 2 ) ) / 4 ; return a ; } public static void Main ( ) { float r = 5 ; Console . WriteLine ( " " + trapezoidarea ( r ) ) ; } }