Monday, 19 September 2016

DS-LAB(AREA OF TRAINGLE)-EXPERIMENT-9

Algorithm: 

INPUT a, b, c 
s = (a + b + c) / 2 
area = sqrt(s(s-a)(s-b)(s-c)) 
PRINT area 
END 

FLOWCHART:

Image result for flowchart for area of triangle

PROG:

#include<iostream.h>
#include<conio.h>
#include<math.h>

int 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();
 return 0;
}

No comments:

Post a Comment