Ask a Teacher



HOW TO WRITE A C++ PROGRAMME TO FIND THE AREA OF A TRIANGLE

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
int a,b,c;
float s,A;
float x=1/2;

clrscr();
cout<<"Enter three sides of a triangle\n";
cin>>a>>b>c;
s=(a+b+c)/2;
A=pow((s(s-a)(s-b))(s-c)),x);
cout<<"AREA OF TRIANGLE\n"<<A;
getch();
}


comments powered by Disqus