title: How does compiler read these expressions? Why am I getting these outputs(All variables are initialized as 1)?
body: <pre><code>int x = 1 , y = 1 , z = 1  ;
  </code></pre>
  
  <p>Now check these lines of code :- </p>
  
  <pre><code>cout &lt;&lt; (++x || ++y)&lt;&lt;endl;     //Output 1
  cout &lt;&lt; x &lt;&lt;" " &lt;&lt; y;          // now x = 2 and y = 1 . Why 'y' is not incremented ?
  </code></pre>
  
  <p>again values are initialized to 1</p>
  
  <pre><code>cout &lt;&lt;(++x &amp;&amp; ++y )&lt;&lt;endl;     //Output 1
  cout &lt;&lt; x &lt;&lt;" " &lt;&lt; y;         //now x = 2 and y = 2 . Why 'y' is incremented ?
  </code></pre>
  
  <p>again values are initialized to 1</p>
  
  <pre><code>cout &lt;&lt; (++x ||++y &amp;&amp; ++z )&lt;&lt;endl;  //Output 1
  cout &lt;&lt; x&lt;&lt;" "&lt;&lt; y&lt;&lt;" "&lt;&lt;z ;       //now x = 2 , y = 1 , z = 1.Why these outputs? 
  </code></pre>
  
  <p>Can some one explain me how compiler reads these codes ?
  I read about the Precedence order but I can't figure out how compiler works on these types of code.Even a  Small help will be appreciated! </p>