title: Why does "int x = 5; printf("%d %d %d", x==5, x=10, x==5);" in C print "0 10 0"?
body: <p>I've been studying C for about a year now, and I came across this above when I was just playing around. I first thought maybe it's a case of assignment precedence (i.e. x=10 happens first), but then I tried</p>
  
  <pre><code>printf("%d %d %d", x==5, x=10, x&lt;6);
  </code></pre>
  
  <p>and it outputs
  <code>0 10 1</code>. Could someone please explain to me why/what is going, as this seems extremely baffling to me and I'm starting to think it's undefined behavior perhaps?</p>