Sum of the series 1.2 . 3 + 2.3 . 4 + ... + n ( n + 1 ) ( n + 2 ) | Efficient CPP program to find sum of the series 1.2 . 3 + 2.3 . 4 + 3.4 . 5 + ... ; function to calculate sum of series ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int sumofseries ( int n ) { return ( n * ( n + 1 ) * ( n + 2 ) * ( n + 3 ) / 4 ) ; } int main ( ) { cout << sumofseries ( 3 ) << endl ; return 0 ; }