Data Structures & AlgorithmsHardGATE CS · TCS NQT
How many trailing zeros does 1000! have in base 10?
- A. 250
- B. 251
- C. 249
- 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.
Practise more Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questionsArrays, Strings, Linked Lists, Stacks, Queues and Hashing: notes and key points
More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions
- How many integers x in [1, 300] satisfy x ≡ 1 (mod 4) and x ≡ 2 (mod 3)?
- What is Euler's totient phi(360), the number of integers in [1, 360] coprime to 360?
- How many unordered pairs of distinct integers {a, b} from 1 to 12 are coprime to each other?
- What is the sum of i^3 mod 7 over i = 1 to 20?
- How many 1 bits does the binary representation of 45 contain?
- A robot on a circle of 8 positions (0 to 7) starts at 0 and jumps 3 positions forward each step, wrapping around. After how many steps…