title: What is the order in a for loop?
body: <p>I'm trying to solve Problem 5 of project euler and I the answer I keep getting is wrong:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  main() 
  {
      int num;
      int x = 0;
      for (num = 20; x == 0; num++)
      {
          if ((num%1) == 0 &amp;&amp; (num%2) == 0 &amp;&amp; (num%3) == 0 &amp;&amp; (num%4) == 0 &amp;&amp; (num%5) == 0 &amp;&amp; (num%6) == 0 &amp;&amp; (num%7) == 0 &amp;&amp; (num%8) == 0 &amp;&amp; (num%9) == 0 &amp;&amp; (num%10) == 0 &amp;&amp; (num%11) == 0 &amp;&amp; (num%12) == 0 &amp;&amp; (num%13) == 0 &amp;&amp; (num%14) == 0 &amp;&amp; (num%15) == 0 &amp;&amp; (num%16) == 0 &amp;&amp; (num%17) == 0 &amp;&amp; (num%18) == 0 &amp;&amp; (num%19) == 0 &amp;&amp; (num%20) == 0)
          x = 1;
      }
      printf("%d %d", num, x);
  }
  </code></pre>
  
  <p>My program keeps printing out <code>232792561</code> (I am aware that I'm printing x, this is simply for troubleshooting purposes). </p>
  
  <p>The verbatim output I'm getting is: <code>232792561 1</code>. </p>
  
  <p>I did some research and I found that the correct answer to the problem is <code>232792560</code>. 
  I am now beginning to believe that the problem lies in the for loop. </p>
  
  <p>What does the loop do first, the iteration (<code>num++</code>) or the test (<code>x == 0</code>)?</p>