title: Ternary operator precedence in c
body: <p>In the following code output is 1 but it should be 2 . how ?</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main()
  {
          int count=0,i;
          int num[4]={1,2,3,4};
  
          for(i=0;i&lt;4;++i)
              count = count+(num[i]%2==1)?1:0;
  
          printf("%d",count);
          return 0;
  }
  </code></pre>