Data Structures & AlgorithmsHardGATE CS · TCS NQT

How many trailing zeros does 1000! have in base 10?

  1. A. 250
  2. B. 251
  3. C. 249
  4. D. 253

Correct answer: C. 249

Trailing zeros equal the exponent of 5 in 1000!: floor(1000/5) + floor(1000/25) + floor(1000/125) + floor(1000/625) = 200 + 40 + 8 + 1 = 249.

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

Exams that ask this topic