Program for Calculating the Area of triangle using Three sides

#include /* for printf and scanf functions*/
#include /* for sqrt function*/

void main()
{ float a,b,c,s,area; /* a,b,c are three sides, s is perimeter */
printf("Enter Three sides of a triangle ");
scanf("%f%f%f",&a, &b, &c);
s = (a + b + c)/2;
area = sqrt( s * (s-a) * (s-b) * (s-c))
printf("Area of a triangle is %f",area);
}

Comments