For given positive integer n, take factorial of that number. How many trailing zeros does it have?

Example: factorial(11) = 39916800

Its last zero-digit count is 2.

Optional: Can you make an efficient algorithm for a very large n?

Solution Stats

144 Solutions

66 Solvers

Last Solution submitted on Mar 20, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers66

Suggested Problems

More from this Author9

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!