Find Nth term of the series 1 , 5 , 32 , 288 ... | CPP code to generate ' Nth ' terms of this sequence ; Function to generate a fixed \ number ; Finding nth term ; Driver Method
#include <bits/stdc++.h> NEW_LINE using namespace std ; int nthTerm ( int N ) { int nth = 0 , i ; for ( i = N ; i > 0 ; i -- ) { nth += pow ( i , i ) ; } return nth ; } int main ( ) { int N = 3 ; cout << nthTerm ( N ) << endl ; return 0 ; }