see the topic :(

nothing too advanced... im only up to looping. if statements and variables

Printable View

- 02-25-2002Unregistereddetermining if a # is prime
see the topic :(

nothing too advanced... im only up to looping. if statements and variables - 02-25-2002Barjor
There was a good thread on this topic last week. please search the board

- 02-25-2002OneStiffRod
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-2002Evil RobotQuote:

*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

- 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

Anyway, that thread is right here :)

http://www.cprogramming.com/cboard/s...ighlight=prime