The Sieve of Eratosthenes
Author |
Message |
7243s
|
Posted: Mon Jun 08, 2009 4:13 pm Post subject: The Sieve of Eratosthenes |
|
|
hello i am trying to find the program that outputs all the prime numbers between 2 & n
the problem with the forums given b4 is dat the array are not really put to use
since i got the project today and its due in 2 days gives me a lot to worry about
if any of u nice people out there have the code with all my requirement(in this case just the use of arrays) i could really put it to use
thnxxxx
reply soon!!!!!  |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Analysis Mode
|
Posted: Mon Jun 08, 2009 4:37 pm Post subject: Re: The Sieve of Eratosthenes |
|
|
You shouldn't ask for solutions, especially for homework, on this forum. That is an unethical thing to do, and it presents a disadvantages to your classmates who aren't aware of this site. If you could outline in more detail what your problem with the Sieve of Eratosthenes is, perhaps we could help you. |
|
|
|
|
 |
Kharybdis

|
Posted: Mon Jun 08, 2009 4:39 pm Post subject: RE:The Sieve of Eratosthenes |
|
|
well.. do you have to put all of your numbers into an array starting with the first prime in element 1, then 2nd prime in element 2?
for finding out all the primes up to n.. just do a linear search where you find all numbers than can be prime upto n. if you find one, put it in the next element of the array. |
|
|
|
|
 |
|
|