Hendecagonal number | C ++ program to find nth Hendecagonal number ; Function to find Hendecagonal number ; Formula to calculate nth Hendecagonal number ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int hendecagonal_num ( int n ) { return ( 9 * n * n - 7 * n ) / 2 ; } int main ( ) { int n = 3 ; cout << n << " rd ▁ Hendecagonal ▁ number : ▁ " ; cout << hendecagonal_num ( n ) ; cout << endl ; n = 10 ; cout << n << " th ▁ Hendecagonal ▁ number : ▁ " ; cout << hendecagonal_num ( n ) ; return 0 ; }