title: Condition in a 'for' loop
body: <p>I am experimenting about what can be put into a <em>for</em> loop declaration in C and how it can be used. I tried the following:</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int stupid(int a)
  {
      if(a == 3)
          return 1;
      else
          return 3;
  }
  
  int main(void)
  {
      int i, j;
      for(i=0; stupid(i)==3,i&lt;10; i++)
          printf(&quot;%d\n&quot;, i);
      return 0;
  }
  </code></pre>
  <p>When I run the program it just prints the number from 1 to 10, and if I use <code>&amp;&amp;</code> instead of comma between the <code>stupid(i)==3</code> and <code>i&lt;10</code>, then the program just prints the numbers up to 3. Why?</p>
  <p>I don't really understand how this works and I was expecting the loop to pass all numbers and &quot;skip&quot; 3, but continue up to 10 and that's not really happening. Why does this happen? Is there some site where this is more clearly explained?</p>