Sum of product of consecutive Binomial Coefficients | CPP Program to find sum of product of consecutive Binomial Coefficient . ; Find the binomial coefficient upto nth term ; C [ 0 ] = 1 ; nC0 is 1 ; Compute next row of pascal triangle using the previous row ; Return the sum of the product of consecutive binomial coefficient . ; finding the sum of product of consecutive coefficient . ; Driven Program
#include <bits/stdc++.h> NEW_LINE using namespace std ; #define MAX  100 NEW_LINE void binomialCoeff ( int C [ ] , int n ) { for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = min ( i , n ) ; j > 0 ; j -- ) C [ j ] = C [ j ] + C [ j - 1 ] ; } } int sumOfproduct ( int n ) { int sum = 0 ; int C [ MAX ] = { 0 } ; binomialCoeff ( C , n ) ; for ( int i = 0 ; i <= n ; i ++ ) sum += C [ i ] * C [ i + 1 ] ; return sum ; } int main ( ) { int n = 3 ; cout << sumOfproduct ( n ) << endl ; return 0 ; }