text: Program to demonstrate the getchar function. The program will read data entered via the keyboard. And returns the number of characters entered. Read more about C Programming Language .
  /***********************************************************
  * You can use all the programs on
  * for personal and learning purposes. For permissions to use the
  * programs for commercial purposes,
  * contact info@c-program-example.com
  * To find more C programs, do visit
  * and browse!
  *
  * Happy Coding
  ***********************************************************/
  #include <stdio.h>
  #define RETURN 'n' /* n == return in UNIX
  r == return in DOS */
  main()
  {
  int count=0;
  puts("Please enter some text.");
  /* Count the letters in the 'stdin'
  buffer. */
  while ( getchar() != RETURN) count++;
  printf("You entered %d charactersn", count);
  })