Data Structures & AlgorithmsHardGATE CS · ICPC regional

What is the smallest positive integer n such that n! has exactly 10 trailing zeros?

  1. A. 46
  2. B. 47
  3. C. 49
  4. D. 45

Correct answer: D. 45

Trailing zeros of n! change only at multiples of 5; 40! has just 9 zeros, so 10 is first reached at n = 45 and holds until 49.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic