title: comma separated expression in while loop in C
body: <p>I never saw such a <strong>while</strong> statement before.</p>
  
  <pre><code>while(printf("&gt; "), fgets(str, 100, stdin), !feof(stdin)) {
  ..
  ..
  }
  </code></pre>
  
  <p>I read online, that the condition to come out of while loop is the rightmost one [ !feof(stdin) ].
  Then, what is the use of the above <strong>while</strong> statement as opposed to</p>
  
  <pre><code>while(!feof(stdin))
  {
         printf("&gt; ");
         fgets(str, 100, stdin);
         ...
         ...
  }
  </code></pre>
  
  <p>Also, <strong>while</strong> statement takes an expression, so is 1,1,1 a valid expression in C?</p>