title: Input does not exit in c, thus output does not work
body: <p>I am just learning c, and I am using Linux terminal. I have written the following simple code, but when I type the inputs, the file does not exit and thus does not count the number of characters. Can anyone help me with it? I have tried other input codes as well. It's the same with all my input related codes. What am I doing wrong? Please help.</p>
  
  <pre><code>main()
  {    
      /* count characters in input */    
      printf("Type some characters and the program will count the number of characters: ");
  
      int c = getchar();
  
      while(c!=EOF &amp;&amp; c!= '\n')    
          ++c;
  
      printf("Number of characters typed: %1d\n", c);    
  }
  </code></pre>