Data Structures & AlgorithmsModerateGATE CS · TCS NQT

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

  1. A. 504
  2. B. 500
  3. C. 503
  4. D. 508

Correct answer: C. 503

Trailing zeros come from factors of 10, and there are always more factors of 2 than 5, so the count is the exponent of 5: floor(2024/5) + floor(2024/25) + ...

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

Exams that ask this topic