(int num)
| 2 | |
| 3 | public class QuestionB { |
| 4 | public static int countFactZeros(int num) { |
| 5 | int count = 0; |
| 6 | if (num < 0) { |
| 7 | System.out.println("Factorial is not defined for negative numbers"); |
| 8 | return 0; |
| 9 | } |
| 10 | for (int i = 5; num / i > 0; i *= 5) { |
| 11 | count += num / i; |
| 12 | } |
| 13 | return count; |
| 14 | } |
| 15 | |
| 16 | public static int factorial(int num) { |
| 17 | if (num == 1) { |