title: Why is "i" variable getting incremented twice in my program?
body: <p>One of my friend showed me this program and asked me why is <code>i</code> variable getting incremented twice. </p>
  
  <p>According to my understanding <code>MAX(i++, ++j);</code> in this line <code>i</code> is first send as a parameter and then incremented, so if the initial value of <code>i</code> is <code>10</code> then the incremented value should be <code>11</code>, but it shows the incremented value of <code>i</code> as <code>12</code>.</p>
  
  <p><strong>Program :</strong> </p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  #define MAX(x,y) (x)&gt;(y)?(x):(y)
  
  void main(void)
  {
      int i = 10;
      int j = 5;
      int k = 0;
  
      k = MAX(i++, ++j);
  
      printf("%d %d %d",i,j,k);
  }
  </code></pre>
  
  <p><strong>Output :</strong> </p>
  
  <blockquote>
    <p>12 6 11</p>
  </blockquote>
  
  <p>Can someone please explain me how is the value incremented to 12 ?</p>
  
  <p>Thanks.</p>