- 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

Here we will see how to get the area of one hexagon using diagonal length. The diagonal length of the hexagon is d.

The interior angles of a regular hexagon are 120° each. The sum of all interior angles are 720°. If the diagonal is d, then area is −

#include <iostream> #include <cmath> using namespace std; float area(float d) { if (d < 0) //if d is negative it is invalid return -1; float area = (3 * sqrt(3) * d*d)/8.0; return area; } int main() { float r = 10; cout << "Area : " << area(r); }

Area : 64.9519

- Related Questions & Answers
- Area of hexagon with given diagonal length in C Program?
- Find length of Diagonal of Hexagon in C++
- Diagonal of a Regular Hexagon in C++ Program
- Area of a square from diagonal length in C++
- Diagonal of a Regular Hexagon in C++?\n
- C Program for Area of a square inscribed in a circle which is inscribed in a hexagon?
- Area of a n-sided regular polygon with given side length in C++
- C++ program to find the Area of the Largest Triangle inscribed in a Hexagon?
- Area of the Largest Triangle inscribed in a Hexagon in C++
- Program for Area Of Square in C++
- Area of a circle inscribed in a regular hexagon?
- Program for Surface area of Dodecahedron in C++
- Program for Surface Area of Octahedron in C++
- C Program for Area And Perimeter Of Rectangle
- Area of a square inscribed in a circle which is inscribed in a hexagon in C Program?

Advertisements