How to get a true bool if a number is primary

Hey all!

I need help. Im trying to make a program that will cout every number from 1 to 1000 that is prymary (1,2,3,5,7).
I dont need the whole function, i just need some sort of if statement that would return a true boolean that tells if the number is primary.
Thanks in a advance.
closed account (z05DSL3A)
http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes

there have been loads of post here about prime number a search should give you all you need.

BTW 1 in not a prime number.
Last edited on
Topic archived. No new replies allowed.