Program to check if N is a Hexadecagonal Number | C ++ program for the above approach ; Function to check if N is a hexadecagonal number ; Condition to check if the number is a hexadecagonal number ; Driver Code ; Given Number ; Function call
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool ishexadecagonal ( int N ) { float n = ( 12 + sqrt ( 112 * N + 144 ) ) / 28 ; return ( n - ( int ) n ) == 0 ; } int main ( ) { int N = 16 ; if ( ishexadecagonal ( N ) ) { cout << " Yes " ; } else { cout << " No " ; } return 0 ; }