Largest hexagon that can be inscribed within a square | C ++ Program to find the biggest hexagon which can be inscribed within the given square ; Function to return 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 = 0.5176 * a ; return x ; } int main ( ) { float a = 6 ; cout << hexagonside ( a ) << endl ; return 0 ; }