Area = sqrt(s*(s-a)*(s-b)*(s-c))
where s=(a+b+c)/2
#include<iostream.h>#include<conio.h>#include<math.h>void main(){float a,b,c,s,Area;cout<<"Enter three sides of triangle ";cin>>a>>b>>c;s=(a+b+c)/2;Area=sqrt(s*(s-a)*(s-b)*(s-c));cout<<"Area of triangle is "<<Area;getch();}
Comments
Post a Comment