Campbell Ritchie wrote:Please post that code again with indentation, so we can readily see which endXXX corresponds to which XXX. I think your end yes might be better written as endIf. What happens if you enter negative numbers? How are you trying to find whether a number is prime or not? You do realise that iterating all numbers smaller than the as.
Well, I don't want to get into something more difficult, first I would start with positives, if that works well, then expand to negatives.
Step by Step.rgument is an inefficient way to find prime number