// To evaluate and display the area of the triangle whose sides are given.
#include
#include
#include
void main()
{
float area,s,s1,s2,s3;
clrscr();
printf("\nPlease enter the three sides of triangle:\n");
scanf("%f%f%f",&s1,&s2,&s3);
s = (s1+s2+s3)/2;
area = s*(s-s1)*(s-s2)*(s-s3);
printf("\nThe area of the triangle is %f",sqrt(area));
getch();
}
No comments:
Post a Comment