JAVA SMALL FACTORIAL PROBLEM

http://www.codechef.com/problems/FCTRL2
MY SOLUTION==http://www.codechef.com/viewsolution/4404292
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
//