It is necessary to calculate the factorial of a number.
When the result is too large, it goes beyond long or int .
What can be done in this case?
int n = 101; long res = n; int count = n - 1; do { res *= count; count--; } while (count > 0); System.out.println(res);