Answers for "C++ Area of Scalene Triangle"

C++
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;
Posted by: Guest on March-03-2022

Code answers related to "C++ Area of Scalene Triangle"

Browse Popular Code Answers by Language