# program to find the area of a Pentagon

program to find the area of a Pentagon on fibonacci, factorial, prime, armstrong, swap, reverse, search, sort, stack, queue, array, linkedlist, tree, graph etc.

## Program to find the area of a pentagon

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

1. Create variables 's' and 'a' and assign its value as 10 and 6.
2. Create variable area_pentagon equals to (5/2)X(s)X(a) as per the formula of calculating the area of the Pentagon.

O(1)

### C Program

```#include
int main()
{
int s=13;
int a=5;
float area_pentagon=(5.0/2.0)*s*a;
printf("Area of the pentagon=%0.1f",area_pentagon);
}
```

Output:

```Area of the pentagon=162.5
```

### PHP Program

```<?php
\$s=13;
\$a=5;
\$area_pentagon=(5/2)*\$s*\$a;
echo "Area of the pentagon=";
echo \$area_pentagon;
?>
```

Output:

```Area of the pentagon=162.5
```

### Java Program

```public class pentagon{
public static void main(String args[])
{
int s=13;
int a=5;
float area_pentagon=(float)(5.0/2.0)*s*a;
System.out.println("Area of the pentagon="+area_pentagon);
}
}
```

Output:

```Area of the pentagon=162.5
```

### C# Program

```using System;
public class Program
{
public static void Main()
{
int s=13;
int a=5;
double area_pentagon=(double)(5.0/2.0)*s*a;
Console.WriteLine("Area of the pentagon="+area_pentagon);
}
}
```

Output:

```Area of the pentagon=162.5
```

### Python Program

```s=13
a=5
area_pentagon=(5.0/2.0)*s*a
print("Area of the pentagon="+str(area_pentagon))
```

Output:

```Area of the pentagon=162.5
```

Next Topic#