- Related Questions & Answers
- Diagonal of a Regular Pentagon in C++ Program
- Program to find the Area of a Parallelogram in C++
- C Program for Program to find the area of a circle?
- Program to find the Area of an Ellipse in C++
- Program to find the Area and Perimeter of a Semicircle in C++
- Java program to find the area of a rectangle
- Java program to find the area of a triangle
- Java program to find the area of a circle
- Java program to find the area of a square
- Python Program to find the area of a circle
- Program to find area of a Circular Segment in C++
- Diagonal of a Regular Pentagon in C++?
- Program to find the Area of an Ellipse using C++
- Program to find the Area and Volume of Icosahedron in C++
- C++ program to find the Area of the Largest Triangle inscribed in a Hexagon?

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

In this problem, we are given a number n that denotes that side of the pentagon. Our task is to create a program to find the Area of a Pentagon in C++.

Pentagon is a five-sided geometric figure.

**Regular pentagon** is a pentagon with all five sides and angles equal.

**Let’s take an example to understand the problem,**

a = 7

84.3

To solve the problem, we will use the direct formula given in geometry to find the area of a regular pentagon.

Area=$\frac{\square^2}{4}\sqrt{5(5+2\sqrt{5_{\blacksquare}})}$

Or

Area=$\frac{(6.8819)\square^2}{4}$

**Program to illustrate the working of our solution,**

#include <iostream> using namespace std; float calcpentagonArea(int a){ return ( ((6.8819)*a*a)/4); } int main() { int a = 7; cout<<"The area of regular pentagon of side "<<a<<" is"<<calcpentagonArea(a); return 0; }

The area of regular pentagon of side 7 is 84.3033

Advertisements