WAP to calculate & print area of a triangle.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
C program to find area of a triangle
int main() { double a, b, c, s, area;
printf("Enter sides of a triangle\n"); scanf("%lf%lf%lf", &a, &b, &c);
s = (a+b+c)/2; // Semiperimeter.
area = sqrt(s*(s-a)*(s-b)*(s-c));
printf("Area of the triangle = %.2lf\n", area
Verified answer
Please refer to the attachment.
Please note that it is written in Java programming language