Answer the question
In order to leave comments, you need to log in
Why is there a lot of zeros at the end of the factorial calculation?
There is a simple factorial calculation code using BigInteger
BigInteger res = BigInteger.ONE;
int n = 100;
for(int i = 1; i <= n; i++) {
res = res.multiply(BigInteger.valueOf(i));
}
System.out.print(res);
Answer the question
In order to leave comments, you need to log in
Because starting from 5! all factorials end in zero (or zeros).
See table of values
https://ru.wikipedia.org/wiki/%D0%A4%D0%B0%D0%BA%D...
PS it looks like your value is incorrect
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question