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