n | CPP program to find n - th term of the series 2 , 12 , 36 , 80 , 150 , . . ; Returns n - th term of the series 2 , 12 , 36 , 80 , 150 ; driver code
#include <iostream> NEW_LINE using namespace std ; int nthTerm ( int n ) { return ( n * n ) + ( n * n * n ) ; } int main ( ) { int n = 4 ; cout << nthTerm ( n ) ; return 0 ; }