C++ Area of Scalene Triangle

[ad_1]

C++ Area of Scalene Triangle
    float a, b, c, d, e;

    cout << "Finding the Area of Scalene Triangle using Heron's Formula\n";
    cout << "1st Side of a Triangle: ";
    cin >> a;
    cout << "2nd Side of a Triangle: ";
    cin >> b;
    cout << "Angle Between Sides: ";
    cin >> c;

    e = 0.5 *  (a + b + c); 	//(a + b + c) / 2
    d = sqrt(e*(e-a)*(e-b)*(e-c));

    cout << "The area is: " << d << endl;

[ad_2]

Please follow and like us:
Content Protection by DMCA.com