Data Structures & AlgorithmsModerateGATE CS · TCS NQT

How many integers x in [1, 500] have digit sum equal to 10?

  1. A. 44
  2. B. 45
  3. C. 47
  4. D. 43

Correct answer: D. 43

Split by the hundreds digit and count the tens and units pairs with the required sum; 500 itself has digit sum 5 and does not count.

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

Exams that ask this topic