Counting zeros in a factorial(terminal + zeros in between digits)

152 Views Asked by At

The usual questions involving counting zeros in a factorial asks us to count only the terminal zeros. This question asks to count the zeros that are in between digits, for example, 8! (40320, has a zero between 4 and 3).

Why causes a zero to appear in between two non-zero digits in a factorial?