|
Very good, that's not even the way I was thinking, but it works very nicely. Good job problem solving.
The final thing is to make the program more user-friendly. If it's not prime, the user might want to know why. Print which number caused the loop to break, to show which number it is equally divisible by.
P.S. Good catch on starting count at 2, because every number is divisible by 1. It could have taken a while to realise that error while debugging the problem.
|