Skip to content

Commit 1470df2

Browse files
Abhishek Jasiwalabranhe
Abhishek Jasiwal
authored andcommitted
Added Simplest algorithm for SumSquareBinomial
1 parent 4dbd283 commit 1470df2

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
Program :To find the sum of square of
3+
binomial coefficient.
4+
5+
This Program is contributed by Abhishek Jaiswal
6+
*/
7+
#include <bits/stdc++.h>
8+
using namespace std;
9+
10+
int factorial(int begin, int end)
11+
{
12+
int num = 1;
13+
for (int i = begin; i <= end; i++)
14+
num *= i;
15+
16+
return num;
17+
}
18+
19+
int square(int n)
20+
{
21+
return factorial(n + 1, 2 * n) / factorial(1, n);
22+
}
23+
24+
int main()
25+
{
26+
int n;
27+
cout << "Enter the number :";
28+
cin >> n;
29+
cout << "The Sum of Square is " << square(n) << endl;
30+
return 0;
31+
}
32+

0 commit comments

Comments
 (0)