/******
 * getchar-example.c
 *
 * A simple program illustrating the uses of getchar and putchar.
 * Program prompts the user to type a letter, 
 *         reads the single character, and
 *         prints the single letter read
 *         ignores any characters beyond the first one read
 ******/

#include <stdio.h>

int
main (void)
{
  int a; /* getchar returns an int so we can test for EOF */

  printf("Enter a letter: ");
  a = getchar();
  
  if (a != '\n')
    putchar (a);
  putchar ('\n');

  return 0;
} // main
