Area of largest triangle that can be inscribed within a rectangle | C # Program to find the biggest triangle which can be inscribed within the rectangle ; Function to find the area of the triangle ; a and b cannot be negative ; area of the triangle ; Driver code
using System ; class GFG { static float trianglearea ( float l , float b ) { if ( l < 0 b < 0 ) return - 1 ; float area = ( l * b ) / 2 ; return area ; } public static void Main ( ) { float l = 5 , b = 4 ; Console . WriteLine ( trianglearea ( l , b ) ) ; } }