Dsa
Math
Hard
Factorial Trailing Zeros
Determine how many trailing zeros are present in N! (N factorial). The number of trailing zeros in the factorial of a number is determined by the number of times 5 is a factor (as pairs of 2 and 5 create zeros). The input is a single integer N (0 <= N <= 10^7).
Example Input:
100
Example Output:
24
Key concepts
mathfactorialtrailing zeros
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now