Data Structures & AlgorithmsVery hardICPC regional · Amazon SDE OA

What is the sum of the decimal digits of 2^20?

  1. A. 32
  2. B. 29
  3. C. 31
  4. D. 2

Correct answer: C. 31

2^20 = 1048576 whose digits sum to 31. Doubling the exponent to 2^19 changes the digit sum, so it is a different value.

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

Exams that ask this topic