The Pentagon is defined as a polygon which has 5 sides that are equal. The 5 angles present in the Pentagon are also equal. A Pentagon can be divided into 5 similar triangles. The measurement of each interior angle in a regular pentagon 108 degrees.
The Formula to calculate the area of the Pentagon is,
Where
s is the side of the Pentagon.
a is the apothem length.
Algorithm
- Create variables 's' and 'a' and assign its value as 10 and 6.
- Create variable area_pentagon equals to (5/2)X(s)X(a) as per the formula of calculating the area of the Pentagon.
Complexity
O(1)
Input:
s = 13
a = 5;
Output:
Area of Pentagon = (5.0/2.0) * s * a
= (5.0/2.0) * 13 * 5
= 162.5
C Program
Output:
PHP Program
Output:
Java Program
Output:
C# Program
Output:
Python Program
Output: