How to find all prime numbers up to 1000 in an One dimensional array ?

Posted by Nav234 under C# on 9/22/2010 | Points: 10 | Views : 2647 | Status : [Member] | Replies : 1
Hi all,
Read it carefully and give the C# code for the below

Using 1000 sized One-Dimensional Array ,write a program that finds all primes.

Directions :
2 is a prime ,
Starting with 4,erase all multiples of 2 larger than 2
Erase 4,6,8,10,12,14,16,....etc.
Find next number to 2 ,that is not erased,
Similarly Scan entire array & remaining in the array should be Prime Numbers.

Thanks in advance

S.Naveen...


Responses

Posted by: T.saravanan on: 9/23/2010 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi Nav234,

Are you try anything for this question? (or) Do you want full code?

Thanks,
T.Saravanan

Nav234, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response