Of course, factorials become very large, very fast. You overflow the boundaries of int very quickly ... and at some point you will be multiplied by enough coefficients to get an overflow to 0, which then will keep the value at 0 forever.
According to a quick Google search of 66, the factorial is 5.44344939 × 10 92 which significantly exceeds int , or even long or decimal . You can get a double to handle this - you will lose enormous accuracy, and it will also accumulate very quickly, but at least it will not overflow ...
source share