Sum of sum | C ++ program to implement the above approach ; Function to find the sum ; Driver code
#include <iostream> NEW_LINE #include <math.h> NEW_LINE using namespace std ; long sumOfSumSeries ( int n ) { return ( n * ( n + 1 ) * ( n + 2 ) ) / 6 ; } int main ( ) { int N = 5 ; cout << sumOfSumSeries ( N ) ; return 0 ; }