"because 25! is a Huge number that even can't be stored in "long int. .try to use "unsigned long long int" it may work since this type can store bigger numbersyou must know that computers are limited so even at long long long....int you may find that 40! is not working because that number is even bigger than the total number of AToms in earth.