Program to check if N is a Hendecagonal Number | C ++ program for the above approach ; Function to check if N is a Hendecagonal Number ; Condition to check if the number is a hendecagonal number ; Driver Code ; Given Number ; Function call
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool ishendecagonal ( int N ) { float n = ( 7 + sqrt ( 72 * N + 49 ) ) / 18 ; return ( n - ( int ) n ) == 0 ; } int main ( ) { int N = 11 ; if ( ishendecagonal ( N ) ) { cout << " Yes " ; } else { cout << " No " ; } return 0 ; }