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