Find Nth term of the series 1 , 8 , 54 , 384. . . | CPP program to find N - th term of the series : 1 , 8 , 54 , 384. . . ; calculate factorial of N ; calculate Nth term of series ; Driver Function
#include <iostream> NEW_LINE using namespace std ; int fact ( int N ) { int i , product = 1 ; for ( i = 1 ; i <= N ; i ++ ) product = product * i ; return product ; } int nthTerm ( int N ) { return ( N * N ) * fact ( N ) ; } int main ( ) { int N = 4 ; cout << nthTerm ( N ) ; return 0 ; }