DanielG @ Tue Feb 03, 2009 5:33 pm wrote:
your mistake is going from 1 .. x, it should be 1.. x-1, also, make sure you don't check one, since it is NOT a prime but will be shown as one by the formula you have written
even though my problem is already solved by the help of cavetroll, I still want to point out that the program will not output 1 whatsoever
because if i put
the loop will only go once, therefore, it is impossible for the value of "counter" to be 2
so if "number" is equal to 1, the program will not output 1