title: Working of conditional compilation #if and #else (and others) in c
body: <p>I tried to write a program using some conditional compilation pre-processing directives instead of "if-else" as follows.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main ()
  {
      int x;
      scanf ("%d",&amp;x);
  #if (x==5)
      printf ("x is 5");
  #else
      printf ("x not 5");
  #endif
  }
  </code></pre>
  
  <p>But the thing is, it always print the else part even though value of <code>x</code>is <code>5</code>. My simplest question is-----><strong>WHY?</strong></p>
  
  <p>Is it possible to successfully complete this program (i.e taking value of x from user and check conditions using #if directive and print statement under #if).</p>
  
  <p>During compilation it shows a warning <strong><em>"'x' is not defined, evaluates to 0"</em></strong>. But <code>x</code> seems defined to me. Does that mean <code>x</code> should be defined using <code>#define</code>. Please explain me concept behind Conditional Compilation.</p>