Search:

Type: Posts; User: laserlight

Search: Search took 0.24 seconds.

  1. Replies
    6
    Views
    24,013

    Personally, I would write that part as: if (i...

    Personally, I would write that part as:

    if (i % 3 == 0 || i % 5 == 0)
    {
    sum += i;
    }
  2. Replies
    6
    Views
    24,013

    You are double counting. Try i = 15, for example.

    You are double counting. Try i = 15, for example.
Results 1 to 2 of 2