Find length of Diagonal of Hexagon | Function to find the diagonal of the hexagon ; side cannot be negative ; diagonal of the hexagon ; Driver code
< ? php function hexadiagonal ( $ a ) { if ( $ a < 0 ) return -1 ; return 2 * $ a ; } $ a = 4 ; echo hexadiagonal ( $ a ) ; ? >