This programming task, is to calculate ANY binomial coefficient.
However, it has to be able to output , which is 10.
This formula is recommended:
double Factorial(double nValue)
double result = nValue;
double pc = nValue;
result_next = result*(pc-1);
result = result_next;
nValue = result;
double EvaluateBinomialCoefficient(double nValue, double nValue2)
if(nValue2 == 1)return nValue;
result = (Factorial(nValue))/(Factorial(nValue2)*Factorial((nValue - nValue2)));
nValue2 = result;
cout<<"The Binomial Coefficient of 5, and 3, is equal to: "<< EvaluateBinomialCoefficient(5,3);
The Binomial Coefficient of 5, and 3, is equal to: 10
Content is available under GNU Free Documentation License 1.2.