Well, we all know that if N is given it\'s easy to calculate N!. But what about the inverse?
N! is given and you are about to find N - Is that possible ? I\'m curio
int inverse_factorial(int factorial){ int current = 1; while (factorial > current) { if (factorial % current) { return -1; //not divisible } factorial /= current; ++current; } if (current == factorial) { return current; } return -1; }