title: Is it possible to use a if statement inside #define?
body: <p>I'm trying to make a macro with the following formula: <code>(a^2/(a+b))*b</code>, and I want to make sure that the there will be no dividing by zero. </p>
  
  <pre><code>#define SUM_A( x, y ) if( x == 0 || y == 0) { 0 } else { ( ( ( x * x ) / ( ( x ) + ( y ) ) ) * ( y ) )}
  </code></pre>
  
  <p>and then I call the macro inside main:</p>
  
  <pre><code>float a = 40, b = 10, result; 
  result = SUM_A(a, b); 
  printf("%f", result);
  </code></pre>
  
  <p>I've tried using brackets around the if function but I keep getting syntax errors before the if statement. I've also tried using return, but I read somewhere that you're not supposed to use that in define. </p>