ProgrammingHard

How many integers from 1 to 100 are divisible by 6 or by 9?

  1. A. 22
  2. B. 27
  3. C. 17
  4. D. 11

Correct answer: A. 22

There are 16 multiples of 6, 11 of 9 and 5 of 18. Inclusion-exclusion gives 16 + 11 - 5 = 22.

More C Programming questions

Exams that ask this topic