C Program to Find Area of a Triangle

C Program to Find Area of a Triangle explains implementation program to Find Area of Triangle using C language syntax. C Program to Find Area of a Triangle program collects required input values to find Area of Triangle.


Formula of area of any triangle:
Area = v(s*(s-a)*(s-b)*(s-c))
Where s = (a + b + c)/2

#include<stdio.h>
#include<math.h>
void main()
{
float a,b,c,s,area;

printf(“Enter sides of triangle : \n”);
scanf(“%f%f%f”,&a,&b,&c);

s = (a+b+c)/2;
area = sqrt(s*(s-a)*(s-b)*(s-c));

printf(“Area of triangle is : %.3f”, area);
}

Share this