Program to check if N is a Tridecagonal Number or not | C ++ implementation to check that a number is a Tridecagon number or not ; Function to check that the number is a Tridecagon number ; Condition to check if the number is a Tridecagon number ; Driver Code ; Function call
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool isTridecagon ( int N ) { float n = ( 9 + sqrt ( 88 * N + 81 ) ) / 22 ; return ( n - ( int ) n ) == 0 ; } int main ( ) { int i = 13 ; if ( isTridecagon ( i ) ) { cout << " Yes " ; } else { cout << " No " ; } return 0 ; }