n | CPP program to find n - th term of series ; Function to find the nth term of series ; Loop to add 4 th powers ; Driver code
#include <iostream> NEW_LINE using namespace std ; int sumOfSeries ( int n ) { int ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) ans += i * i * i * i ; return ans ; } int main ( ) { int n = 4 ; cout << sumOfSeries ( n ) ; return 0 ; }