Area of a triangle in C
C program to find the area of a triangle using Heron's or Hero's formula. The input of the program is the lengths of sides of the triangle. The triangle exists if the sum of any of its two sides is greater than the third side. The program assumes that a user will enter valid input.
To find the area of a triangle, multiply the base by the height, and then divide by 2. The division by 2 comes from the fact that a parallelogram can be divided into 2 triangles. For example, in the diagram to the left, the area of each triangle is equal to one-half the area of the parallelogram.
A triangle is one of the most basic shapes in geometry. The best known and the simplest formula, which almost everybody remembers from school is: area = 0.5 * b * h , where b is the length of the base of the triangle, and h is the height/altitude of the triangle.
-Cyber School