...

/

Example 68: Sieve of Eratosthenes

Example 68: Sieve of Eratosthenes

Learn how to implement the Sieve of Eratosthenes procedure.

We'll cover the following...

Problem

The sieve of Eratosthenes is the procedure of generating all prime numbers up to a given limit.

Implement a function that generates prime numbers from 1 to 100 using the sieve of Eratosthenes algorithm, which is defined as such:

  • Step 1: Fill an array num[ 100 ] with numbers from 1 to
...