Program to check if N is a Concentric Hexagonal Number | C # program to check if N is a concentric hexagonal number ; Function to check if the number is a concentric hexagonal number ; Condition to check if the number is a concentric hexagonal number ; Driver Code ; Function call
using System ; class GFG { static bool isConcentrichexagonal ( int N ) { float n = ( float ) Math . Sqrt ( ( 2 * N ) / 3 ) ; return ( n - ( int ) n ) == 0 ; } public static void Main ( ) { int N = 6 ; if ( isConcentrichexagonal ( N ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }