Try running the code as if you were the computer:
1. Pick an input number (say, 15)
2. number > 15, continue with the method
2. i = 2
3. 15 % 2 = 1, so return true
obviously 15 is not prime...
Type: Posts; User: helloworld922
Try running the code as if you were the computer:
1. Pick an input number (say, 15)
2. number > 15, continue with the method
2. i = 2
3. 15 % 2 = 1, so return true
obviously 15 is not prime...
Please surround your code with [highlight] tags. They make it much easier to read. Also, it's much easier to read your code if it's tabbed to the correct indentation.
It is printing out the prime...