Scientific Calculator
gssymeon/Combination
By George
Combination of n over x (5 out of 49)
Tagged:
// Combinations of 'r' out of total of 'n'
var Combination = function()
{
var pc = "";
var pc = prompt("Enter number of items to be selected (r)", "r combinations of n", "3");
var r = number(pc);
var pc = prompt("Enter Total number of items (n)", "r combinations of n", "5");
var n = number(pc);
comb = n! /(r! * (n - r)!);
var msg=concat("Arrangements of ", string(r), " out of Total ", string(n), " is ", string(comb));
alert(msg, "COMBINATIONS");
};
1 Comment
Sign in to leave a comment