ProgrammingVery hard

A sieve of Eratosthenes up to n = 100 marks composites by starting each prime p at p*p, and only for p*p <= n. How many marking operations are performed in total?

  1. A. 100
  2. B. 168
  3. C. 90
  4. D. 104

Correct answer: D. 104

Primes 2, 3, 5 and 7 mark 49, 31, 16 and 8 entries, respectively. 49 + 31 + 16 + 8 = 104.

More C Programming questions

Exams that ask this topic