Evaluate binomial coefficients: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 1,630: | Line 1,630: | ||
which results from the definition of ncr in terms of factorials. |
which results from the definition of ncr in terms of factorials. |
||
=={{header|Nanoquery}}== |
|||
<lang Nanoquery>def binomialCoeff(n, k) |
|||
result = 1 |
|||
for i in range(1, k) |
|||
result = result * (n-i+1) / i |
|||
end |
|||
return result |
|||
end |
|||
if main |
|||
println binomialCoeff(5,3) |
|||
end</lang> |
|||
=={{header|Nim}}== |
=={{header|Nim}}== |