c - Cannot get switch() to repeat itself after -
is called as the title. I have tried to do everything and I can not get it to work I have tried things with var, cin, COAT, boolean And I can not get this F ******* to repeat myself. I have been crawling through countless forums while reading the instructions and I can not do anything. Can you edit it in such a way that if a user omits anything then the user is presented again with the menu and the option to enter the number will be really appreciated. Can not do it yourself & lt; Iostream & gt; I do not have the ability to set it as required (my codeboxes are telling me its mistake)
#include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; Int main () // main work {printf ("airport reservation system \ n"); ("Menu" ; Switching (menu_number) // Making Navigation Menu {Case 1: printf ("flight"); breakdown; Case 2: printf ("passenger"); breakage; case 3: printf ("reservation"); breakdown; defaults; ;} Return 0; // If the program is successful, then return zero}
I have modified the code here so long as you do not accept it You will inquire about an entry.
int menu_number; int accept = 0; while (accept!) {If (scanf ("% d", and menu_number)! = 1) Switching (menu_number) // Navigation menu to keep running {puts ("error in input!"); Break up; // or "continue;"} {Case 1: printf ("flight"); approved = 1; Case 2: Procedure ("passenger"); Approved = 1; breakage; Case 3: printf ("Reservation"); Approved = 1; Breakdown; Default: Brake;}}
Comments
Post a Comment