Find length of Diagonal of Hexagon | C # Program to find the diagonal of the hexagon ; Function to find the diagonal of the hexagon ; side cannot be negative ; diagonal of the hexagon ; Driver code
using System ; class GFG { static float hexadiagonal ( float a ) { if ( a < 0 ) return - 1 ; return 2 * a ; } public static void Main ( ) { float a = 4 ; Console . WriteLine ( hexadiagonal ( a ) ) ; } }