see the topic :(
nothing too advanced... im only up to looping. if statements and variables
Printable View
see the topic :(
nothing too advanced... im only up to looping. if statements and variables
There was a good thread on this topic last week. please search the board
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.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.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