generally in c and c++ , the minimum requirements are
signed char: -2^07+1 to +2^07-1
short: -2^15+1 to +2^15-1
int: -2^15+1 to +2^15-1
long: -2^31+1 to +2^31-1
long long: -2^63+1 to +2^63-1
so to find out the limit of the number that can be entered, you would have to look for two numbers whose factorials fall just below and just above the range of long, i.e., 2^31 - 1 in the minimal case
to increase this limit, you might consider using long long
or maybe unsigned long long