ok now for the probs!!!
for (i=2; (i<sqrt(n));i++) {
should have been
for (i=2; (i<=sqrt(n));i++) {
when you "fixed" it, you missed the =
Type: Posts; User: Crossfire
ok now for the probs!!!
for (i=2; (i<sqrt(n));i++) {
should have been
for (i=2; (i<=sqrt(n));i++) {
when you "fixed" it, you missed the =
curious why you changed x to i?
also you changed your code from
for (n=2;n<=sqrt(x);n++) {
if((x%n)==0)
to
after testing this, casting int as a double doesnt make a difference to it at all....surprising i know!!!
BUT doing the
int prime=1;
and using an IF to check if prime=0 to display "is prime"...