home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / qc / qc25 / else.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-15  |  269 b   |  16 lines

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