Data Structures & AlgorithmsHardGATE CS · TCS NQT

How many integers in [2, 20] are neither divisible by 2 nor by 3?

  1. A. 7
  2. B. 6
  3. C. 8
  4. D. 10

Correct answer: B. 6

The remaining numbers are 5, 7, 11, 13, 17 and 19, so the count is 6. The number 1 is excluded by the range starting at 2.

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

Exams that ask this topic