Hectagon Number | C ++ program for above approach ; Finding the nth hectagon Number ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int hectagonNum ( int n ) { return ( 98 * n * n - 96 * n ) / 2 ; } int main ( ) { int n = 3 ; cout << "3rd ▁ hectagon ▁ Number ▁ is ▁ = ▁ " << hectagonNum ( n ) ; return 0 ; }