// Combinations Calculator - finds the number of possible combinations that can be taken from a set
fn factorial(n:i32)->i32 {
if n == 1 || n == 0 {
return 1;
}
return n * factorial(n - 1);
}
fn main() {
let n:i32 = 7;
let r:i32 = 3;
let ncr:i32 = factorial(n) / (factorial(r) * factorial(n - r));
println!("nCr = {}", ncr);
}
/*
run:
nCr = 35
*/