Data Structures & AlgorithmsHardGATE CS · ICPC regional

How many integers n in [1, 100] have both n and n + 2 prime?

  1. A. 9
  2. B. 10
  3. C. 12
  4. D. 8

Correct answer: D. 8

The lower members of twin prime pairs up to 99 are 3, 5, 11, 17, 29, 41, 59 and 71, which is 8 pairs.

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

Exams that ask this topic