Program to find the Nth term of the series 3 , 7 , 13 , 21 , 31. ... . | CPP program to find the Nth term of given series . ; Function to calculate sum ; Return Nth term ; driver code ; declaration of number of terms ; Get the Nth term
#include <iostream> NEW_LINE #include <math.h> NEW_LINE using namespace std ; long long int getNthTerm ( long long int N ) { return ( pow ( N , 2 ) + N + 1 ) ; } int main ( ) { long long int N = 11 ; cout << getNthTerm ( N ) ; return 0 ; }