Here is my code. When i launch, command prompt [cmd.exe] keeps opening and closing non-stop. Can anybody tell me whats wrong?Code:#include<stdio.h> #include<conio.h> #include<stdlib.h> int foodsel; struct info { char name[35]; char loc[99]; float avgcostpermeal; int foodtype; struct info *next; }*newnode, *prev, *tmp,*list; main() { createlist(); menu(); } menu() { int choose; printf("\nHit 1 to Add a New Restaurant!"); printf("\nHit 2 to View All Entries!"); printf("\nHit 3 to Search!"); printf("\nHit 4 to Exit!"); printf("\n\n\n\nYour Selection:"); scanf("%d",&choose);fflush(stdin); system("cls"); do { switch(choose) { case 1 : { insert(); break; } case 2 : { viewall(); break; } case 3 : { find(); break; } case 4 :{ byebye(); break; } default: { printf("\n\nInvalid input! Hit Any Key to Return to The Main Menu!"); getch(); system("cls"); break; } } }while(choose!=4); } createlist() { list=NULL; } insert() { char resname[35]; char resloc[99]; float resprice; int position; newnode=(struct info*)malloc (sizeof(struct info)); typeoffood(); printf("\nName of Restaurant:");fflush(stdin); scanf("%[^\n]",resname); system("cls"); printf("\nLocation of Restaurant:");fflush(stdin); scanf("%[^\n]",resloc); system("cls"); printf("\nAverage Cost per Meal At The Restaurant:");fflush(stdin); scanf("%f",&resprice); system("cls"); strcpy(newnode->name,resname); newnode->next=NULL; strcpy(newnode->loc,resloc); newnode->next=NULL; newnode->avgcostpermeal=resprice; newnode->next=NULL; newnode->foodtype=foodsel; newnode->next=NULL; if(list==NULL) list=newnode; else if(resprice < list->avgcostpermeal) { newnode->next=list; list=newnode; } else { tmp=list;position=0; while(tmp!=NULL && position==0) { if(resprice >= tmp->avgcostpermeal) { prev=tmp; tmp=tmp->next; } else { position=1; } } newnode->next=prev->next; prev->next=newnode; position=0; } system("cls"); menu(); } display() { system("cls"); if (list == NULL) printf("\nSorry, No Data Entry Was Found\n\n"); else { tmp=list; while(tmp!=NULL) { printf("%s\n",tmp->name); printf("%.2f\n",tmp->avgcostpermeal); printf("%s\n",tmp->loc); printf("%d\n\n",tmp->foodtype); tmp=tmp->next; } } } typeoffood() { int foodchoice; printf("\nVariants of Food Served:"); printf("\nHit 1 for Malay Culture Food!"); printf("\nHit 2 for Chinese Culture Food!"); printf("\nHit 3 for Indian Culture Food!"); printf("\nHit 4 for Western Culture Food!"); printf("\nHit 5 for Japanese Culture Food!"); printf("\nHit 6 for Italian Culture Food!"); printf("\n\n\n\nYour Selection:"); scanf("%d",&foodchoice);fflush(stdin); switch(foodchoice) { case 1 : { printf("\nMalay Culture Food."); printf("%d",foodchoice); system("cls"); foodsel=1; break; } case 2 : { printf("\nChinese Culture Food."); printf("%d",foodchoice); system("cls"); foodsel=2; break; } case 3 : { printf("\nIndian Culture Food."); printf("%d",foodchoice); system("cls"); foodsel=3; break; } case 4 :{ printf("\nWestern Culture Food."); printf("%d",foodchoice); system("cls"); foodsel=4; break; } case 5 :{ printf("\nJapanese Culture Food."); printf("%d",foodchoice); system("cls"); foodsel=5; break; } case 6 :{ printf("\nItalian Culture Food."); printf("%d",foodchoice); system("cls"); foodsel=6; break; } } } find() { char name[35]; printf("Restaurant Name?"); gets(name);fflush(stdin); tmp=list; while(tmp!= NULL) { if(strcmp(name, tmp->name)== 0) { printf("\nThese Are The Restaurants Available In The Database:"); printf("\n\nName: %s",tmp->name); printf("\nAddress: %s",tmp->loc); printf("\nAverage Cost Per Meal: %.2f",tmp->avgcostpermeal); if(tmp->foodtype==1) { printf("\nMalay Culture Food\n"); } else if(tmp->foodtype==2) { printf("\nChinese Culture Food\n"); } else if(tmp->foodtype==3) { printf("\nIndian Culture Food\n"); } else if(tmp->foodtype==4) { printf("\nWestern Culture Food\n"); } else if(tmp->foodtype==5) { printf("\nJapanese Culture Food\n"); } else { printf("\nItalian Culture Food\n"); } break; } else { printf("Invalid Input! Please Try Again."); } tmp=tmp->next; } getch(); } viewall() { int select; printf("\nHit 1 to view by least cost per meal"); printf("\nHit 2 to view by food type"); scanf("%d",&select); if (select==1) { tmp=list; while(tmp != NULL) { printf("\n restaurant name: %s \n",tmp->name);fflush(stdin); printf("\n addresss: %s \n average cost per meal: %.2f ",tmp->loc,tmp->avgcostpermeal); if(tmp->foodtype==1) { printf("\nMalay Culture Food\n"); } else if(tmp->foodtype==2) { printf("\nChinese Culture Food\n"); } else if(tmp->foodtype==3) { printf("\nIndian Culture Food\n"); } else if(tmp->foodtype==4) { printf("\nWestern Culture Food\n"); } else if(tmp->foodtype==5) { printf("\nJapanese Culture Food\n"); } else { printf("\nItalian Culture Food\n"); } tmp=tmp->next; } } else { select=0; printf("\nselect what type of food u want to display"); printf("\nHit 1 for display Malay Culture Food"); printf("\nHit 2 for display Chinese Culture Food"); printf("\nHit 3 for display Indian Culture Food"); printf("\nHit 4 for display Western Culture Food"); printf("\nHit 1 for display Japanese Culture Food"); printf("\nHit 1 for display Italian Culture Food"); scanf("%d",&select); if (select==1) { tmp=list; while(tmp != NULL) {if(tmp->foodtype==1) { printf("\n restaurant name: %s \n",tmp->name);fflush(stdin); printf("\n addresss: %s \n average cost per meal: %.2f ",tmp->loc,tmp->avgcostpermeal); printf("\nMalay Culture Food\n"); } tmp=tmp->next; } } else if (select==2) { tmp=list; while(tmp != NULL) { if(tmp->foodtype==2) { printf("\n restaurant name: %s \n",tmp->name);fflush(stdin); printf("\n addresss: %s \n average cost per meal: %.2f ",tmp->loc,tmp->avgcostpermeal); printf("\nChinese Culture Food\n"); } tmp=tmp->next; } } else if (select==3) { tmp=list; while(tmp != NULL) {if(tmp->foodtype==3) { printf("\n restaurant name: %s \n",tmp->name);fflush(stdin); printf("\n addresss: %s \n average cost per meal: %.2f ",tmp->loc,tmp->avgcostpermeal); printf("\nIndian Culture Food\n"); } tmp=tmp->next; } } else if (select==4) { tmp=list; while(tmp != NULL) {if(tmp->foodtype==4) { printf("\n restaurant name: %s \n",tmp->name);fflush(stdin); printf("\n addresss: %s \n average cost per meal: %.2f ",tmp->loc,tmp->avgcostpermeal); printf("\nWestern Culture Food\n"); } tmp=tmp->next; } } else if (select==5) { tmp=list; while(tmp != NULL) { if(tmp->foodtype==5) {printf("\n restaurant name: %s \n",tmp->name);fflush(stdin); printf("\n addresss: %s \n average cost per meal: %.2f ",tmp->loc,tmp->avgcostpermeal); printf("\nJapanese Culture Food\n"); } tmp=tmp->next; } } else { tmp=list; while(tmp != NULL) { if(tmp->foodtype==5) {printf("\n restaurant name: %s \n",tmp->name);fflush(stdin); printf("\n addresss: %s \n average cost per meal: %.2f ",tmp->loc,tmp->avgcostpermeal); printf("\nItalian Culture Food\n"); } tmp=tmp->next; } } } } byebye() { exit(1); }