title: PHP sum up all EVEN numbers from 0 to 200
body: <p>I tried to sum up all even numbers from 0 to 200 and I found 2 possible working ways, however the third method (the most efficient one) gives me a headache. Here's what I did so far:</p>
  
  <p>First method:</p>
  
  <pre><code>$total = 0;
  $number = 0;
  
  while ($number &lt; 200)
  {
      if ($number % 2 == 0)
      {
          $total = $total + $number;
      }
      $number++;
  }
  
  echo $total;
  </code></pre>
  
  <p>Second method:</p>
  
  <pre><code>    $total = 0;
      for($number = 0; $number &lt; 200; $number+=2) 
      {
          $total += $number;
      }
  echo $total;
  </code></pre>
  
  <p>Third method (can't get it to work)</p>
  
  <pre><code>echo array_sum(range(1,200,2));
  </code></pre>
  
  <p>How should I change my last method so that it works as intended?</p>
  
  <p>Edit: Seems that none of the methods work: the output should be 10100 but it is 9900 for the first two methods and 10000 for the third.</p>