Header Ads Widget

Responsive Advertisement

Write a program to calculate the area of triangle using formula at=√s(s-a)(s-b)(s-c).

#include<stdio.h>


#include<math.h>

int main() 

float a, b, c,s,area; 


printf("Enter the 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 %f",area); 

 

return 0; 

}


Post a Comment

0 Comments