I had to write this program based on the algorithm given at the beginning of the program. This program has a range of error, but I still can't figure out where & how to fix it. Could you please help?
// Exercise 13 (Ch.4)
// Based on the Sieve of Eratosthenes algorithm provided on www.wikipedia.org
1. Create a list of consecutive integers from two to n: (2, 3, 4, ..., n).
2. Initially, let p equal 2, the first prime number.
3. Strike from the list all multiples of p greater than p.
4. Find the first number remaining on the list greater than p (this number is the next prime);
Let p equal this number.
5. Repeat steps 3 and 4 until p2 is greater than n.
6. All the remaining numbers on the list are prime.
int square(int x)
unsigned int n=100;
unsigned int i, p;
// Create a list of consecutive integers from 2 - n
p=2; // First prime number
if(numbers[i]>p && (numbers[i]%p)!=0)