Chat with our AI personalities
Factorial for number N is N x N-1 x N-2 X N- (N-1). e.g. if you need to calculate factorial for 5 then compute 5 x 4 x 3 x 2 x 1.
P(n,r)=(n!)/(r!(n-r)!)This would give you the number of possible permutations.n factorial over r factorial times n minus r factorial
int factorial(int n) { int i; int f=1; for(i=2;i<=n;++i) f*=i; return f; }
It is n! or n factorial.
n! = 1*2* ... * (n-1)*n