- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Diagonal of a Regular Hexagon in C++?n
The regular hexagons are comprised of six equilateral triangles so the diagonal of a regular hexagon would be 2*side.
Example
Let us see the following implementation to get the regular Heptagon diagonal from its side −
#include <iostream> using namespace std; int main(){ float side = 12; if (side < 0) return -1; float diagonal = 2*side; cout << "The diagonal of the regular hexagon = "<<diagonal<< endl; return 0; }
Output
The above code will produce the following output −
The diagonal of the hexagon = 24
- Related Articles
- Diagonal of a Regular Hexagon in C++?
- Diagonal of a Regular Hexagon in C++ Program
- Find length of Diagonal of Hexagon in C++
- Diagonal of a Regular Heptagon in C++?
- Diagonal of a Regular Pentagon in C++?
- Diagonal of a Regular Heptagon in C++ Program
- Diagonal of a Regular Pentagon in C++ Program
- Area of hexagon with given diagonal length in C Program?
- Find the number of diagonal in hexagon.
- C Program for area of hexagon with given diagonal length?
- Area of a circle inscribed in a regular hexagon?
- How to make a regular hexagon?
- How to get the perimeter of a regular hexagon?
- The side of a regular hexagon in below figure is denoted by ( l ). Express the perimeter of the hexagon using ( l ).(Hint : A regular hexagon has all its six sides equal in length.)"
- Apothem of a n-sided regular polygon in C++
- How many diagonals does each of the following have?(a) A convex quadrilateral(b) A regular hexagon(c) A triangle.

Advertisements