Write a c program to find area of a triangle area of triangle=(s(s-a)(s-b)(s-c)).Where a, b and c are three sides of the triangle and s=(a+b+c)/2.
Answers
Answered by
2
/* C Program to find Area of a Triangle and Perimeter of a Triangle */
#include<stdio.h>
#include<math.h>
int main()
{
float a, b, c, Perimeter, s, Area;
printf("\nPlease Enter three sides of triangle\n");
scanf("%f%f%f",&a,&b,&c);
Perimeter = a+b+c;
s = (a+b+c)/2;
Area = sqrt(s*(s-a)*(s-b)*(s-c));
printf("\n Perimeter of Traiangle = %.2f\n", Perimeter);
printf("\n Semi Perimeter of Traiangle = %.2f\n",s);
printf("\n Area of triangle = %.2f\n",Area);
return 0;
}
Similar questions