i have the following code that outputs the binomial coefficient of 2 numbers. I would like to include the two numbers in a statement that is printed out along with the overall result but i am receiving the following error:
_ cannot be resolved to a variable
here is my code:
public class BinomialCoefficients
{
private static long binomial(int n, int k)
{
if (k>n-k)
k=n-k;
long b=1;
for (int i=1, m=n; i<=k; i++, m--)
b=b*m/i;
return b;
}
public static void main(String[] args)
{
System.out.println("The Binomial Coefficients of" + n + "and " + k + " is: " + binomial(15, 4));
}
}
any help?