Basically if you had to fnid the next prime after lets say 7. You would test each number after 7 until you found a prime using your isPrime() function.
P.S I Hope to post some maths on evaluating...
Type: Posts; User: Freaky Chris
Basically if you had to fnid the next prime after lets say 7. You would test each number after 7 until you found a prime using your isPrime() function.
P.S I Hope to post some maths on evaluating...
No worries, everyone makes synatically mis-takes from time to time especially when learning. Quite often it just needs a fresh pair of eyes to look at it.
p.s read my edit to previous post
Chris
{
boolean isPrime(int num)
Should be
boolean isPrime(int num)
{
Also another note on Math. You only need to check upto the sqr root of the number, lets say for then number 81 you do not...