Largest triangle that can be inscribed in a semicircle | C # Program to find the biggest triangle which can be inscribed within the semicircle ; Function to find the area of the triangle ; the radius cannot be negative ; area of the triangle ; Driver code
using System ; class GFG { static float trianglearea ( float r ) { if ( r < 0 ) return - 1 ; return r * r ; } public static void Main ( ) { float r = 5 ; Console . Write ( trianglearea ( r ) ) ; } }