///area of triangle = Root of (s(s-a)(s-b)(s-c))
// s = (a+b+c)/2
#include <stdio.h>
float area(float a, float b, float c);
int main()
{
float a,b,c,z;
printf("\n Enter the Values of a,b &c ;");
scanf("%f%f%f",&a,&b,&c);
z=area(a,b,c); //Function Calling
printf("\n Area OF Triangle :%.3f",z);
return 0;
}
float area(float a, float b, float c)
{
float s,m,x;
s=(a+b+c)/2;
m=s*(s-a)*(s-b)*(s-c);
x=sqrt(m);
return(x);
}
Comments
Post a Comment