title: Logical test fails in program with unexpected output
body: <p>I have the folliwing code: </p>
  
  <pre><code>void main() 
  {  
      int a=30,b=40,x;
      x=(a!=10) &amp;&amp; (b=50);  
      printf("x=%d",x);
  }
  </code></pre>
  
  <p>Here in the result I get <code>x=1</code>. In <code>&amp;&amp;</code> operator the condition true only when both are true here the first is true i.e a not equal to 10 , but second is <code>b=50</code> which is wrong then also the value of <code>x</code> is 1 in out put. Why is this happening ?</p>