Question: the following code are to be use with assignment. 8. (25 points) Write a C++ program called sieve.cpp that implements the sieve of Eratosthenes algorithm

 the following code are to be use with assignment. 8. (25

the following code are to be use with assignment.

points) Write a C++ program called sieve.cpp that implements the sieve of

8. (25 points) Write a C++ program called sieve.cpp that implements the sieve of Eratosthenes algorithm in our textbook (page 6~ 7). The following video will help your understanding of the algorithm: https://youtu.be/klcIklsWzrY For the assignment, you can assume that the user always enters a positive integer which is bigger than 1. For the program, you have to use a dynamic memory to create array(s) to store data. For details on the dynamic memory, read http://www.cplusplus.com/doc/tutorial/dynamic/ for p +2 to n do A[p] + p for p +2 to do if A[p] +0 I/see note before pseudocode /lp hasn't been eliminated on previous passes j+ p*p while j

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!