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
using System ; class Solution { static float squareArea ( float a ) { if ( a < 0 ) return - 1 ; float area = ( float ) ( Math . Pow ( 1.268 , 2 ) * Math . Pow ( a , 2 ) ) ; return area ; } public static void Main ( ) { float a = 6 ; Console . WriteLine ( squareArea ( a ) ) ; } }