Any shape that has 3 sides and three angles is called triangle.
To find area of triangle we must know length of all three sides of a triangle.
C Code
C++ Code
Working of Program:
When the above code is executed it will require 3 inputs a , b and c respectively.After input is given these values will be stored in a,b and c variables respectively.Here is main formula for calculating triangle area.
area =sqrt(s*(s-a)*(s-b)*(s-c));
and
s = (a+b+c)/2;
So first s will be calculated be adding all triangle sides and then dividing answer by two.Now all these values will be used in main formula to calculate triangle formula.Calculated value will be stored in area variable.And finally result will be displayed to the user.
Output:
C
,
C++