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