title: C Programming - comma operator within while loop
body: <p>Prog 1: </p>
  
  <pre><code>#include&lt;stdio.h&gt;
   int main()
   {
       int i=0;
       while(i&lt;=8,i++);
       printf("%d",i);
       return 0;
    }
  </code></pre>
  
  <p>Prog 2:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
   int main()
  {
    int i=0;
    while(i++,i&lt;=8);
    printf("%d",i);
    return 0;
  }
  </code></pre>
  
  <p>The output of Prog 1 is 1 and that of Prog 2 is 9.</p>
  
  <p>Can someone explain whats going here. How the two codes are different?</p>