# Prime Prime Prime Help Help Help

This is a discussion on Prime Prime Prime Help Help Help within the C++ Programming forums, part of the General Programming Boards category; Which rule restricted answering to this thread? 5? We should see the goal of the rule. It wants to prevent ...

We should see the goal of the rule. It wants to prevent dead topics to come on first page. Answering to an unanswered thread is different. For example maybe I have had asked a very hard question that nobody could answered, but 5 months later somebody came and answered it. You think it is illegal? Of course it is not. It is the goal of the forum.

2. Originally Posted by mltngpot
all prime numbers (except 2) are prime, once again wasting precious processes.
shouldn't that read, all prime numbers, other than 2, are odd. ?

so testing for if it is odd, then seeing if it has ANY divisors other than 1 and itself is all you need to do. [ test for division by 2, 3, 5 ]
iand non prime number with divide by one or more of these three.
not all odd number have a square root that is an integer. ie: 15 is not prime, yet does not square root either to an integer. so testing for a square root is not going to result in a prime number.

3. sorry, not thinking, all prime numbers are odd except two.
and no prime number will have an integer sqrt, however, getting the sqrt of the number before hand will eliminate checking the sqrt multiple times. any program like this, is going to be run (most likely) using large numbers, since the small ones are readily available and the math is easy. 2, 3, 5, 7, 11.... so the amount of processes run cuts down signifigantly.

```  sqrtnum = sqrt(iNum);