title: C - Why am I getting two characters excpet one as output?
body: <p>So I create this small program to represent my problem. Run program enter 'a' press ENTER.</p>
  
  <p>C Code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(void)
  {
      char o;
      while(1)
      {
          printf("&gt; ");
          scanf("%c",&amp;o);
          switch(o)
          {
          case 'a' :
              printf("%c\n",o);
              break;
          case 'q' :
              return 0;
          }
      }
  }
  </code></pre>
  
  <p>Output is:</p>
  
  <pre><code>&gt; a
  a
  &gt; &gt; *(waiting for input)*
  </code></pre>
  
  <p>What I expected it to be:</p>
  
  <pre><code>&gt; a
  a
  &gt; *(waiting for input)*
  </code></pre>
  
  <p>Please give me some advice how to get my problem solved. Thank you.</p>