Program to check if N is a triacontagonal number | C ++ program to check whether a number is an triacontagonal number or not ; Function to check whether a number is an triacontagonal number or not ; Condition to check whether a number is an triacontagonal number or not ; Driver Code ; Given number ; Function call
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool istriacontagonal ( int N ) { float n = ( 26 + sqrt ( 224 * N + 676 ) ) / 56 ; return ( n - ( int ) n ) == 0 ; } int main ( ) { int i = 30 ; if ( istriacontagonal ( i ) ) { cout << " Yes " ; } else { cout << " No " ; } return 0 ; }