title: Program doesn't read the last character in a loop
body: <p>So I have a program where you input number 'n', and then you input n number of characters. The program tests if you can form a word 'Nice' with those characters.
  The problem was that whenever I type a character and press enter, the program reads that enter as a character too, so I guess i kinda solved it (?) like this:</p>
  
  <pre><code>    scanf("%c\n")
  </code></pre>
  
  <p>First of all this seems like a not so good solution even to me (I am pretty much new in this).
  Another thing is, when i input a number 4, and input letters 'N' 'i' 'c' and 'e', it won't read that last letter 'e' so the program basically doesn't work so well.
  I hope someone has an explanation for this, and I hope someone could help me. I am sorry if this is a stupid question.</p>
  
  <p>Here is the whole code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  int main(){
  
  int n,i,a,b,c,d;
  char q;
  
  printf("Enter the number of letters: ");
  scanf("%d",&amp;n);
  
  i=1;
  a=0;
  b=0;
  c=0;
  d=0;
  
  while(i&lt;=n){
  
      printf("Type letter no %d: ",i);
      scanf("%c\n",&amp;q);
  
      if(q=='N')
          a++;
  
      if(q=='i')
          b++;
  
      if(q=='c')
          c++;
  
      if(q=='e')
          d++;
  
  i++;
  }
  
  if(a&gt;0 &amp;&amp; b&gt;0 &amp;&amp; c&gt;0 &amp;&amp; d&gt;0)
      printf("Nice.");
  
      else
          printf("Not nice.");
  
  }
  </code></pre>