Be the first user to complete this post

  • 0
Add to List
Beginner

292. Find the Area of a Triangle Given Three Sides – Heron’s Formula

Objective – Given three sides of the triangle, write a program to find the area of a triangle.

Heron’s Formula for finding area of triangle:

  1. First find the semi-parameter of a triangle using the formula, s= (a+b+c)/2 where a, b, c are three sides of the triangle and s will be the semi-parameter.
  2. Then use the below formula to get the area of triangle.
    • Area = √s(s-a)(s-b)(s-c)

Output:

Area of triangle : 7.826237921249264 sq uni