Exercise: Implement the Sieve of Eratosthenes

Try to implement the sieve of Eratosthenes algorithm to generate prime numbers.

Problem statement

In this challenge, you’ll be given a positive integer nn greater than 11, and you’ll count the number of prime numbersA prime number is an integer greater than 1 that is divisible only by 1 and itself. in the range 22 to nn.

Get hands-on with 1200+ tech skills courses.