//Header files
#include <iostream>
#include <math.h>
using namespace std;
// Create a main function
int main()
{
//Declaring Variables
double Area=0;
double a=0,b=0,c=0,s=0;
cout<<"Enter the lengthof side (a): ";
cin>>a;
cout<<"Enter thelength of side (b): ";
cin>>b;
cout<<"Enter thelength of side (c): ";
cin>>c;
//The formula for computing
s=(a+b+c)/2;
Area=sqrt(s*(s-a)*(s-b)*(s-c));
//Result
cout<<endl<<endl<<"The area ofthe triangle: "<<Area<<endl;
cin.get();
return 0;
}
Comments
Leave a comment