title: What is the correct way to define this C macro?
body: <pre><code>#include &lt;stdio.h&gt;
  #define ABS(a)  (a) &lt; 0 ? -(a) : (a)
  int main(void)
  {
    printf("%d\n", ABS(-3) + 1);
    return 0;
  }
  </code></pre>
  
  <p>This code snippet, from Herbert Schildt's book, looks like it will produce the output <code>4</code> but it actually prints <code>3</code>. Why?</p>
  
  <p>How do I fix it?</p>