Find the nth term of the series 0 , 8 , 64 , 216 , 512 , . . . | C ++ implementation of the approach ; Function to return the nth term of the given series ; Common difference ; First term ; nth term ; nth term of the given series ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; long term ( int n ) { int d = 2 ; int a1 = 0 ; int An = a1 + ( n - 1 ) * d ; An = pow ( An , 3 ) ; return An ; } int main ( ) { int n = 5 ; cout << term ( n ) ; return 0 ; }