title: Input reading using scanf hangs
body: <p>I am programming in C and i have a problem when i run a program in the cmd terminal. here is the code i use:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
  
      int num;
  
      printf("enter a number: ");
      scanf("%i\n", &amp;num);
  
      for(int n = 1; n &lt; num + 1; n++){
          printf("%i\n", n);
      }
  
  
      return 0;
  }
  </code></pre>
  
  <p>Generally, everything works like it should, exept for one thing.
   when I enter a number, nothing happens. there is no output, until I write anything and press Enter, and only then the number appear. </p>
  
  <p>this is a screenshot of what it looks like.
  here is enter the number (and press enter) but nothing happens: <a href="http://prntscr.com/deum9a" rel="nofollow noreferrer">http://prntscr.com/deum9a</a></p>
  
  <p>and this is how it looks like after i entered something random nad all the numbers popped up: <a href="http://prntscr.com/deumyn" rel="nofollow noreferrer">http://prntscr.com/deumyn</a></p>
  
  <p>if anyone knows how to fix this, please tell me (:</p>