Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- void main()
- {
- int toContinue = 1;
- int selection, count = 0;
- char answer;
- while(toContinue)
- {
- printf("Please enter number in the range 1-5:\n");
- scanf("%d", &selection);
- count++;
- switch(selection)
- {
- case 1:
- printf("Disconnecting\n");
- break;
- case 2:
- break;
- case 3:
- printf("Are you sure you would like to cancel your order ???\n plz enter one char:\n" );
- scanf("%c", &answer);
- if('y'==answer ||'Y'==answer)
- {
- printf("canceld");
- toContinue=0;
- }
- break;
- case 4:
- printf("Your position in queue is: %d", count);
- break;
- case 5:
- toContinue=0;
- break;
- default:
- printf("wrong input\n");
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement