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
using System ; class GFG { static float rectanglearea ( float r ) { if ( r < 0 ) return - 1 ; float a = r * r ; return a ; } public static void Main ( ) { float r = 5 ; Console . Write ( ( int ) rectanglearea ( r ) ) ; } }