Largest hexagon that can be inscribed within an equilateral triangle | C ++ program to find the side of the largest hexagon which can be inscribed within an equilateral triangle ; Function to find the side of the hexagon ; Side cannot be negative ; Side of the hexagon ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; float hexagonside ( float a ) { if ( a < 0 ) return -1 ; float x = a / 3 ; return x ; } int main ( ) { float a = 6 ; cout << hexagonside ( a ) << endl ; return 0 ; }