Sum of the series ( 1 * 2 ) + ( 2 * 3 ) + ( 3 * 4 ) + ... ... upto n terms | C ++ implementation of the approach ; Function to return sum ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int sum ( int n ) { return n * ( n + 1 ) * ( n + 2 ) / 3 ; } int main ( ) { int n = 2 ; cout << sum ( n ) ; }