# How many zeros are obtained if we multiply all the natural numbers from 1 to 100? [duplicate]

Options are:

1. 20
2. 21
3. 22
4. 23
5. 24

I recently came across the above question in a competitive exam, where we get about 30 seconds to 1 minute for solving each problem. I want to if there are quick and easy methods to compute the result.

• HINT: The number of $0$'s in a number is equal to the number of times $10$ divides it. – Marcus M Sep 15 '15 at 18:22
• @MarcusM That is not true: consider, for instance, $101$. – Théophile Sep 15 '15 at 18:33
• I think Marcus may have chosen a more accurate duplicate, in hindsight, but I'll leave mine up, just in case. – Cameron Buie Sep 15 '15 at 18:40

As a general rule, the number of $0$s at the end of $k!$ is equal to $$\sum_{i=1}^\infty \left\lfloor\frac{k}{5^i}\right\rfloor$$
The above expression is a measure of how many times $5$ divides $k!$.