Largest Square that can be inscribed within a hexagon | C ++ program to find the area of the largest square that can be inscribed within the hexagon ; Function to find the area of the square ; Side cannot be negative ; Area of the square ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; float squareArea ( float a ) { if ( a < 0 ) return -1 ; float area = pow ( 1.268 , 2 ) * pow ( a , 2 ) ; return area ; } int main ( ) { float a = 6 ; cout << squareArea ( a ) << endl ; return 0 ; }