#include<stdio.h>
#include<conio.h>
main()
{
char c;
printf("Enter the code for the chart: \n");
do
{
scanf("%c",&c);
switch (c)
{
case 'A':printf("Area Chart\n");break;
case 'B':printf("Bar Chart\n");break;
case 'U':printf("Bubble Chart\n");break;
case 'C':printf("Column Chart\n");break;
case 'N':printf("Cone Chart\n");break;
case 'Y':printf("Cylinder Chart\n");break;
case 'D':printf("Doughnut Chart\n");break;
case 'L':printf("Line Chart\n");break;
case 'I':printf("Pie Chart\n");break;
case 'P':printf("Pyramid Chart\n");break;
case 'R':printf("Radar Chart\n");break;
case 'S':printf("Scatter Chart\n");break;
case 'F':printf("Surface Chart\n");break;
case 'K':printf("Stock Chart\n");break;
default:printf("The code is not valid.\n");
}
}
while (c=='\n');
getch();
}
The program is working fine, but after inputting the first code for the chart, the program terminates. What should i do so that after inputting the first code i can input another?