title: read char from console
body: <p>I write console application which performs several scanf for int
  And after it ,I performs getchar :</p>
  
  <pre><code>int x,y;
  char c;
  printf("x:\n");
  scanf("%d",&amp;x);
  printf("y:\n");
  scanf("%d",&amp;y);
  c = getchar();
  </code></pre>
  
  <p>as a result of this I get <code>c = '\n'</code>,despite the  input is: </p>
  
  <pre><code>1
  2
  a
  </code></pre>
  
  <p>How this problem can be solved?</p>