home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c021 / 7.img / EXAMPLES.ZIP / INTRO13.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-04  |  689 b   |  30 lines

  1. /* INTRO13.C--Example from Chapter 4 of Getting Started */
  2.  
  3. #include <conio.h>
  4. #include <stdio.h>
  5. #include <ctype.h>
  6.  
  7. int main()
  8. {
  9.    char cmd;
  10.  
  11.    printf("Chart desired: Pie  Bar  Scatter  Line  Three-D");
  12.    printf("\nPress first letter of the chart you want: ");
  13.    cmd = toupper(getch());
  14.    printf("\n");
  15.  
  16.    if (cmd == 'P')
  17.       printf("Doing pie chart\n");
  18.    else if (cmd == 'B')
  19.       printf("Doing bar chart\n");
  20.    else if (cmd == 'S')
  21.       printf("Doing scatter chart\n");
  22.    else if (cmd == 'L')
  23.       printf("Doing line chart\n");
  24.    else if (cmd == 'T')
  25.       printf("Doing 3-D chart\n");
  26.    else printf("Invalid choice.\n");
  27.  
  28.    return 0;
  29. }
  30.