- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

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

# Area of largest Circle inscribe in N-sided Regular polygon in C Program?

Here we will see how to get the area of the circle which is inscribed in N-sided regular polygon. The N (number of sides) are given, and each side of the polygon is ‘a’

The approach is simple. One N sided polygon can be divided into N equal triangles, the whole angle for each triangle in center is 360/N, so −

## Example

#include <iostream> #include <cmath> using namespace std; float area(float n, float a) { if (n < 0 || a < 0 ) //if the valuse are negative it is invalid return -1; float r = a/(2.0*tan((180/n) * 3.14159/180)); float area = 3.14159 * r*r; return area; } int main() { float n = 8, a = 4; cout << "Area : " << area(n, a); }

## Output

Area : 73.2422

- Related Questions & Answers
- Area of largest Circle inscribed in N-sided Regular polygon in C Program?
- Area of a n-sided regular polygon with given Radius in C Program?
- Area of a n-sided regular polygon with given Radius?
- Area of a n-sided regular polygon with given side length in C++
- Apothem of a n-sided regular polygon in C++
- Determine the position of the third person on regular N sided polygon in C++ Program
- Determine the position of the third person on regular N sided polygon in C++?
- Find number of diagonals in n sided convex polygon in C++
- Find the area of largest circle inscribed in ellipse in C++
- Area of a polygon with given n ordered vertices in C++
- Area of a circle inscribed in a regular hexagon?
- C program to print area of triangle, square, circle, rectangle and polygon using switch case.
- Probability that the pieces of a broken stick form a n sided polygon in C++
- Area of circle inscribed within rhombus in C Program?
- Program to find area of a polygon in Python

Advertisements