# determining if a # is prime

• 02-25-2002
Unregistered
determining if a # is prime
see the topic :(

nothing too advanced... im only up to looping. if statements and variables
• 02-25-2002
Barjor
There was a good thread on this topic last week. please search the board
• 02-25-2002
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
• 02-25-2002
Evil Robot
Quote:

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.
• 02-25-2002
_Will333_
Quote:

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