home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / c / other / learn / if1.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-07  |  253 b   |  15 lines

  1. /* IF.C: Demonstrate if statement. */
  2.  
  3. #include <stdio.h>
  4. #include <conio.h>
  5. #define  B_KEY  'b'
  6.  
  7. main()
  8. {
  9.    char ch;
  10.    printf( "Press the b key to hear a bell.\n" );
  11.    ch = getche();
  12.    if( ch == B_KEY )
  13.       printf( "Beep!\a\n" );
  14. }
  15.