By the way, that loop is incorrect. It checks whether a number is not prime. If we write "return" in a loop, will that loop be still correct in all cases?
Type: Posts; User: angstrem
By the way, that loop is incorrect. It checks whether a number is not prime. If we write "return" in a loop, will that loop be still correct in all cases?
No. Check _manually_ whether you've provided _correct_ "while" condition at for-loop.
Check your for loop's conditions. Analyse when is it true and when is it false.