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

143 Solutions

65 Solvers

Last Solution submitted on Dec 07, 2025

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers65

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!