title: How is the "getchar()" function able to take multiple characters as input?
body: <p>Here is a basic character counting program in C:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(){
      long nc = 0;
  
      while(getchar() != EOF)
          nc++;
      printf("%ld\n" , nc);
  }
  </code></pre>
  
  <p>When I am entering "abcde" as an input, it displays a value of 6(after triggering the EOF test), +1 for the newline character. But my doubt is that <code>getchar()</code>, as its name itself suggests, takes only 1 character into account. But when I am entering "abcde" at one go itself, it still works. Why is this so? What problem am I doing here?</p>