C++ Program to Find Area of Isosceles Triangle

C++ Program to Find Area of Isosceles Triangle

Write C++ Program to Find Area of Isosceles Triangle

// CPP Program to Find Area of Isosceles  Triangle

#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    float a, b, area;

    cout << "Enter Length of Isosceles Triangle's Same Sides :--> ";
    cin >> a;

    cout << "Enter Length of Isosceles Triangle's Third side :--> ";
    cin >> b;

    //formula to find the area of the Isosceles triangle
    area = (b * sqrt((4 * a * a) - (b * b)))/4;

    cout << "The Area of the Isosceles Triangle :--> " << area;

    return 0;
}

Output:

Enter Length of Isosceles Triangle's Same Sides :--> 6
Enter Length of Isosceles Triangle's Third side :--> 8

The Area of the Isosceles Triangle :--> 17.89