C++ program to find the area of the triangle
Answers
Answered by
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();
}
#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
2
void main()
{
int b,h,a;
cout<<"height and base lenght";
cin>>h>>b;
a=(1/2)b*h;
cout<<a;
}
{
int b,h,a;
cout<<"height and base lenght";
cin>>h>>b;
a=(1/2)b*h;
cout<<a;
}
Similar questions