Data Structures & AlgorithmsModerateTCS NQT · CAT

Problem: How many integers from 1 to 100 inclusive are divisible by 7 but not by 14?

  1. A. 7
  2. B. 14
  3. C. 12
  4. D. 93

Correct answer: A. 7

Multiples of 7 up to 100: 14; the even ones (multiples of 14) number 7, leaving 7 odd multiples. 14 ignores the exclusion, subtracting multiples of 49 gives 12, and 93 counts numbers not divisible by 14.

More Coding Interview Problems questions

Exams that ask this topic