Compute area of Triangle Input Three Sides

By | June 17, 2019
/*
 C Program 
how to calculate surface area of a triangle when 
three sides are given
*/

#include<stdio.h>
#include<math.h>

int main()
{
   float side1, side2, side3, s, area;
   printf("Enter the length of first side of triangle =");
   scanf("%f", &side1);
   printf("Enter the length of second side of triangle =");
   scanf("%f", &side2);
   printf("Enter the length of third side of triangle =");
   scanf("%f", &side3);
   s = (side1 + side2 + side3)/2.0;
   area = sqrt(s*(s-side1)*(s-side2)*(s-side3));
   printf("Area of Triangle =%f", area);
   return 0;
}

Image of how to calculate surface area of a triangle when
three sides are given.

how to calculate surface area of a triangle when  three sides are given

how to calculate surface area of a triangle when
three sides are given

Loading

One thought on “Compute area of Triangle Input Three Sides

  1. Pingback: Design and Use Triangle Class - C++ Program | EasyCodeBook.com

Leave a Reply

Your email address will not be published. Required fields are marked *