Data Structures & AlgorithmsHardGATE CS · TCS NQT

How many integers from 1 to 1000 inclusive have a decimal digit sum equal to 10?

  1. A. 64
  2. B. 63
  3. C. 69
  4. D. 66

Correct answer: B. 63

Stars and bars over three digits with each digit at most 9 gives the count; the number 1000 has digit sum 1 and does not change the count.

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

Exams that ask this topic