Evaluate binomial coefficients: Difference between revisions

no edit summary
(choose for Erlang)
No edit summary
Line 98:
Output:
<pre>The Binomial Coefficient of 5, and 3, is equal to: 10</pre>
=={{header|C sharp|C#}}==
<lang csharp>using System;
 
namespace BinomialCoefficients
{
class Program
{
static void Main(string[] args)
{
int n = 5, k = 3;
int result = fact(n) / (fact(k) * fact(n - k));
Console.WriteLine("The Binomial Coefficient of {0}, and {1}, is equal to: {2}", n, k, result);
}
 
static int fact(int n)
{
if (n == 0) return 1;
else return n * fact(n - 1);
}
}
}</lang>
=={{header|Erlang}}==
<lang erlang>
Anonymous user