number
is a value that was entered by the user in a main function and that is being sent to the isPrime function. If this is supposed to be determining whether number
is prime, I think the logic is a little off.
|
|
number%div
calculates the remainder. If number is indeed a divisor, the remainder should be 0. However, if there is a remainder, you're returning true, which is the opposite of what you want.
|
|