ProgrammingHardTCS NQT · Infosys

How many integers from 1 to 100 are divisible by 3 or by 5?

  1. A. 47
  2. B. 46
  3. C. 33
  4. D. 53

Correct answer: A. 47

There are 33 multiples of 3 and 20 multiples of 5, and 6 multiples of 15 counted twice. So 33 + 20 - 6 = 47.

More C Programming questions

Exams that ask this topic