title: Using Nested macros in C
body: <pre><code>#include "stdafx.h"
  #include&lt;stdio.h&gt;
  
  #define PR(x) printf("%d\t",(int)(x));
  #define PRINT(a,b,c) PR(a) PR(b) PR(c)
  #define MAX(a,b) (a&lt;b?b:a)
  
  int main()
  {
      int x=1,y=2;
      //PR(MAX(x++,y));
      PRINT(MAX(x++,y),x,y);  //2,2,2
      PRINT(MAX(x++,y),x,y);  //2,3,2
      return 0;
  }
  </code></pre>
  
  <p><code>x</code> is 1 so the 3 values to be passed as arguments in PRINT is 2 2 2.</p>
  
  <p>Then in the second PRINT the values that will be passed is 2 3 2. So the output should be 2 2 2 2 3 2. But this program outputs as 2 2 2 3 4 2.</p>