home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / ctutor2.zip / SINGLEIO.C < prev    next >
Text File  |  1989-11-10  |  563b  |  30 lines

  1.                                          /* Chapter 9 - Program 2 */
  2. #include <stdio.h>
  3. #include <conio.h>
  4.  
  5. void main()
  6. {
  7. char c;
  8.  
  9.    printf("Enter any characters, terminate program with X\n");
  10.  
  11.    do {
  12.       c = getch();                     /* get a character */
  13.       putchar(c);                  /* display the hit key */
  14.    } while (c != 'X');
  15.  
  16.    printf("\nEnd of program.\n");
  17. }
  18.  
  19.  
  20.  
  21. /* Result of execution
  22.  
  23. Enter any characters, terminate program with X
  24.  
  25. (The output depends on the characters you type in.)
  26.  
  27. End of program.
  28.  
  29. */
  30.