Program to check if N is a Centered heptagonal number | C ++ implementation to check that a number is a Centered heptagonal number or not ; Function to check that the number is a Centered heptagonal number ; Condition to check if the number is a Centered heptagonal number ; Driver Code ; Function call
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool isCenteredheptagonal ( int N ) { float n = ( 7 + sqrt ( 56 * N - 7 ) ) / 14 ; return ( n - ( int ) n ) == 0 ; } int main ( ) { int n = 8 ; if ( isCenteredheptagonal ( n ) ) { cout << " Yes " ; } else { cout << " No " ; } return 0 ; }