Evaluate binomial coefficients

From Rosetta Code
Task
Evaluate binomial coefficients
You are encouraged to solve this task according to the task description, using any language you may know.

This programming task, is to calculate ANY binomial coefficient.

This formula is recommended: n!/k!(n-k)!

C++

<lang cpp>double Factorial(double nValue)

  {
      double result = nValue;
      double result_next;
      double pc = nValue;
      do
      {
          result_next = result*(pc-1);
          result = result_next;
          pc--;
      }while(pc>2);
      nValue = result;
      return nValue;
  }

double EvaluateBinomialCoefficient(double nValue)

  {
      double result;
      result = (Factorial(m_nValue))/(Factorial(nValue)*Factorial((m_nValue - nValue)));
      nValue = result;
      return nValue;
  }</lang>