Computer Science, asked by Penguin1998, 1 year ago

C++ program to find the area of the triangle

Answers

Answered by NikhilMTomy
4
#include <iostream.h>
#include<conio.h>
#include<math.h>

void main()
{
    int a,b,c;
    float area,s;
    cout << "Enter the three sides of a triangle\n";
    cin>>a>>b>>c;
    s=(a+b+c)/2;
    area=sqrt(s*(s-a)*(s-b)*(s-c));
    cout<<"Area of the triangle is "<<area;
    getch();
}
Answered by arakkalvaishnav
2
void main()
{
 int b,h,a;
cout<<"height and base lenght";
cin>>h>>b;
a=(1/2)b*h;
cout<<a;
}
Similar questions