Data Structures & AlgorithmsHardGATE CS · TCS NQT

How many elements of [12, 19, 40, 7, 31, 22, 13, 8] have a decimal digit sum divisible by 4?

  1. A. 6
  2. B. 5
  3. C. 3
  4. D. 1

Correct answer: B. 5

Compute the digit sum of each value (for example 19 gives 10 and 31 gives 4) and test divisibility by 4. Testing the number itself modulo 4 is a different property.

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

Exams that ask this topic