binomial()
is an inbuilt function in julia which is used to return the binomial coefficient
Syntax: binomial(n::Integer, k::Integer) Parameters:Example 1:Returns: It returns the binomial coefficient
- n: Specified number
- k: Specified number
.
# Julia program to illustrate # the use of binomial() method # Getting the binomial coefficient println(binomial( 6 , 4 ))
println(factorial( 6 ) ÷ (factorial( 6 - 4 ) * factorial( 4 )))
|
15 15Example 2:
# Julia program to illustrate # the use of binomial() method # Getting the binomial coefficient println(binomial( 6 , 3 ))
println(binomial( - 6 , 3 ))
println(binomial( - 6 , - 2 ))
println(binomial( 5 , 2 ))
|
20 -56 0 10
Article Tags :
Recommended Articles