Explanation
Three sided polygon is known as Triangle. It has a base and an altitude(height).
Area of Triangle = ½(b × h) where b is base and h is height.
Algorithm
- Define base and height
- Apply in the formula.
- Print the Area.
Complexity
O(1)
Input:
b = 5
h = 12
Output:
Area of Triangle = (b * h) / 2
= (5 * 12) / 2
= 30.0
Python
Output:
C
Output:
JAVA
Output:
C#
Output:
PHP
Output: