Area of a triangle inscribed in a rectangle which is inscribed in an ellipse | C ++ Program to find the area of the triangle inscribed within the rectangle which in turn is inscribed in an ellipse ; Function to find the area of the triangle ; length of a and b cannot be negative ; area of the triangle ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; float area ( float a , float b ) { if ( a < 0 b < 0 ) return -1 ; float A = a * b ; return A ; } int main ( ) { float a = 5 , b = 2 ; cout << area ( a , b ) << endl ; return 0 ; }