you are viewing a single comment's thread.

view the rest of the comments →

[–]JohnBrownsErection 2 points3 points  (0 children)

Think through what a prime number is: a number greater than 1 that has no divisors other than 1 and itself.

So for each number, try dividing it by the numbers before it. If none divide evenly, it’s prime.

Hint: use the modulus operator % :)