# Thread: determining if a # is prime

1. ## determining if a # is prime

see the topic nothing too advanced... im only up to looping. if statements and variables 2. There was a good thread on this topic last week. please search the board 3. isn't a prime an even number? so then it's divisible by 2...

if(number%2==0){//If the number is divisible by 2 it will have a remainder of 0 and thus we call it prime, if it has a remainder then we call it (I forget the term)
}
else //everthing else, not prime numbers 4. Originally posted by OneStiffRod
isn't a prime an even number? so then it's divisible by 2...

if(number%2==0){//If the number is divisible by 2 it will have a remainder of 0 and thus we call it prime, if it has a remainder then we call it (I forget the term)
}
else //everthing else, not prime numbers
No. 5. Originally posted by OneStiffRod
isn't a prime an even number? so then it's divisible by 2...

if(number%2==0){//If the number is divisible by 2 it will have a remainder of 0 and thus we call it prime, if it has a remainder then we call it (I forget the term)
}
else //everthing else, not prime numbers
Prime numbers are numbers that are only be divisible by 1 and themself.

Anyway, that thread is right here http://www.cprogramming.com/cboard/s...ighlight=prime Popular pages Recent additions 