JAVA SMALL FACTORIAL PROBLEM

FCTRL2 Problem - CodeChef
MY SOLUTION==CodeChef: Practical coding for everyone
PLZ EXPLAIN MY FAULT AND DEBUG THE PROGRAMME

To begin with, you don’t need this line, System.out.println("enter a number"); . The computer is automated and it expects to see some answers not command.

Secondly, correctly me if I’m wrong, but I think the class name is supposed to be “Main”. Last but not least, the test case which product for the factorial (100!) is so huge that int nor Long can store it. Better to use BigInteger for this case. Hope this helps.

1 Like