Elight7 Elight7 - 3 years ago 147
Javascript Question

Number combinations program?

My question is the following: I want to write a program that can calculate how many combinations in a given digit.

For example:
How many number combinations in 5 digits?
Which is 5 x 4 x 3 x 2 = 120 combinations!

Answer Source

If i understand you right, i Think this is what you want:

var n = <number>
Math.pow(9,n);

This calculates how many deferent combinations you can have in n digits

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download