Search:

Type: Posts; User: Crossfire

Search: Search took 0.01 seconds.

  1. ok now for the probs!!! for (i=2;...

    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 =
  2. curious why you changed x to i? also you...

    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
  3. after testing this, casting int as a double...

    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"...
Results 1 to 3 of 3