➽ Program:-

#include<iostream>

#include<math.h>

using namespace std;

int main()

{

    float side1, side2, side3, area, s;

    cout<<"Enter length of first side: ";

    cin>>side1;

    cout<<"Enter length of second side: ";

    cin>>side2;

    cout<<"Enter length of third side: ";

    cin>>side3;      

 

    s = (side1+side2+side3)/2;

    area = sqrt(s*(s-side1)*(s-side2)*(s-side3));

 

    cout<<"Area of the triangle is "<< area << endl;

    return 0;

}

➽ Output:-

Enter length of first side: 6
Enter length of second side: 7
Enter length of third side: 8

Area of the triangle is 20.3332