Nonagonal number | CPP Program to find nth nonagonal number . ; Function to find nth nonagonal number . ; Formula to find nth nonagonal number . ; Driver function .
#include <bits/stdc++.h> NEW_LINE using namespace std ; int Nonagonal ( int n ) { return n * ( 7 * n - 5 ) / 2 ; } int main ( ) { int n = 10 ; cout << Nonagonal ( n ) ; return 0 ; }