title: why is printf not called when expected?
body: <p>This is my Code [Note: I am using Eclipse for C/C++ on Windows Platform]</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  
  int main(void) {
      int num;
      printf("Enter a number:\n");
      scanf("%d",&amp;num);
      if(num%2==0)
          printf("Number is Even");
      else
          printf("Number is Odd");
      return EXIT_SUCCESS;
  }
  </code></pre>
  
  <p>Here I have to enter an Integer first only then printf is called... I want to call printf first before I enter an Integer...What am I doing wrong here?</p>
  
  <p>for example this is the output that I get </p>
  
  <pre><code>6
  Enter a number:
  Number is Even
  </code></pre>
  
  <p>and expected output is </p>
  
  <pre><code>Enter a number:
  6
  Number is Even
  </code></pre>