Program to find the Nth term of series | CPP program to find N - th term of the series : 9 , 23 , 45 , 75 , 113 , 159. . ... . ; calculate Nth term of series ; Driver Function ; Get the value of N ; Find the Nth term and print it
#include <iostream> ; using namespace std ; int nthTerm ( int N ) { return ( ( 3 * N * N ) - ( 6 * N ) + 2 ) ; } int main ( ) { int N = 3 ; cout << nthTerm ( N ) ; return 0 ; }