write a program to calculate the area of the triangle using formula at= root s(s-a)(s-b)(s-c)



 Code:-

#include<stdio.h>
#include<math.h>
int main()
{
float s,a,b,c,area;
printf(“Enter sides of the trianglen”);
scanf(“%f%f%f”,&a,&b,&c);
s=(a+b+c)/2;
area=sqrt(s*(sa)*(sb)*(sc));
printf(“Area of the triangle is: %f”,area);
return 0;
}

Output:-

Enter the sides of the triangle
2 3 4
Area of the triangle is : 2.904737



Recommended Post:-

         MCQs:-



Leave a Reply

Your email address will not be published.