View Single Post
Old 02-03-2005, 09:06 PM   #2 (permalink)
MageB420666
<Insert wise statement here>
 
MageB420666's Avatar
 
Location: Hell if I know
Try some nested for loops, run through each of the numbers between 2 and n, dividing each number from 2 to the current number using % division, have a local variable(in the outer loop) set to 0 increment it every time the remainder is 0, if the interior loop completes and the variable is zero, it's a prime number. I think you can figure out how to display each number.
__________________
Apathy: The best outlook this side of I don't give a damn.
MageB420666 is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43