Recently I stumbled across a question of “write a program to calculate the number of trailing zeros in n!” For example, 5! = 1 * 2 * 3 * 4 * 5 = 120. Thus, the number to get out of the program is 1. 10! is 3628800, and should get the result of 2.
(more…)