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