home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / qc_prog / chap04 / mixloops.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-04-05  |  503 b   |  23 lines

  1.  
  2. /* MIXLOOPS.C -- reads characters,       */
  3. /*               beeps for ASCII count   */
  4. /*               uses a while and a for  */
  5.  
  6. #include <conio.h>
  7.  
  8. main()
  9. {
  10.     char ch;
  11.     int  i;
  12.  
  13.     while ((ch = getche()) != ' ')  /* get a char. */
  14.         {
  15.         for (i = 'a'; i <= ch; ++i) /* count up to */
  16.             {                       /* alphabet pos.*/
  17.             printf("In FOR loop!\n");
  18.             printf("\a");  /* sound beep each time */
  19.             }
  20.         }
  21. }
  22.  
  23.