dos_compilers/Borland Turbo C++ v1/EXAMPLES/INTRO14.C

28 lines
688 B
C++
Raw Normal View History

2024-07-02 16:34:51 +02:00
/* INTRO14.C--Example from Chapter 4 of User's Guide */
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
int main()
{
char cmd;
printf("Chart desired: Pie Bar Scatter Line Three-D");
printf("\nPress first letter of the chart you want: ");
cmd = toupper(getch());
printf("\n");
switch (cmd)
{
case 'P': printf("Doing pie chart\n"); break;
case 'B': printf("Doing bar chart\n"); break;
case 'S': printf("Doing scatter chart\n"); break;
case 'L': printf("Doing line chart\n"); break;
case 'T': printf("Doing 3-D chart\n"); break;
default : printf("Invalid choice.\n");
}
return 0;
}