#include<conio.h>
#include<iostream.h>
#include<math.h>
void main()
{
clrscr();
float a,b,c,s,area;
cout<<"enter the side of a, b &c:\n";
cin>>a>>b>>c;
cout<<"a="<<a<<"\n"<<"b="<<b<<"c="<<c<<endl;
if((a>=(b+c))||(b>=(a+c))||(c>=(a+b)))
cout<<"invalid data selected";
else
{
s=(a+b+c)/2;
area=sqrt(s*(s-a)*(s-b)*(s-c));
cout<<"Area of Traingle is:"<<area;
}
getch();
}
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment