Program to check if N is a Concentric Hexagonal Number | Java 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
class GFG { static boolean isConcentrichexagonal ( int N ) { float n = ( float ) Math . sqrt ( ( 2 * N ) / 3 ) ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int N = 6 ; if ( isConcentrichexagonal ( N ) ) { System . out . print ( " Yes " ) ; } else { System . out . print ( " No " ) ; } } }