I\'ve been using this factorial program for Java:
public static long factorial(int a) { if(a<1) { return 1; } long result=1; long
You've overflowed long. Use BigInteger instead.
long
BigInteger