dos_compilers/Borland Turbo C++ v1/EXAMPLES/INTRO14.C
2024-07-02 07:34:51 -07:00

28 lines
688 B
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* 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;
}