home *** CD-ROM | disk | FTP | other *** search
/ FreeWare Collection 2 / FreeSoftwareCollection2pd199x-jp.img / ms_dos / switch / switch2.c < prev    next >
C/C++ Source or Header  |  1990-06-14  |  233b  |  31 lines

  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     char get;
  6.     int input;
  7.     get=getch();
  8.  
  9.     if(get=='y'||get=='Y')
  10.       {
  11.       get='1';
  12.       }
  13.     if(get=='n'||get=='N')
  14.       {
  15.       get='0' ;
  16.       }
  17.  
  18.     return((int)(get-'0'));
  19.  
  20. }
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.