Scientific Calculator

(public) gssymeon/Combination

By gssymeon George

Combination of n over x (5 out of 49)

Tagged: combinations

// 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");
};

spam? | offensive?

1 Comment

Sign in to leave a comment