title: Assignment statement used in conditional operators
body: <p>Can anybody please tell me why this statement is giving an error - Lvalue Required   </p>
  
  <pre><code>(a&gt;b?g=a:g=b); 
  </code></pre>
  
  <p>but this one is correct</p>
  
  <pre><code>(a&gt;b?g=a:(g=b));
  </code></pre>
  
  <p>where <code>a , b</code> and <code>g</code> are integer variables , and <code>a</code> and <code>b</code> are taken as input from keyboard.</p>