fork download
  1. #include <stdio.h>
  2. int main(void) {
  3. int done = 0;
  4. while (!done) {
  5. int choice;
  6. scanf("%d", &choice);
  7. switch (choice) {
  8. case 1:
  9. puts("one");
  10. break;
  11. case 2:
  12. puts("two");
  13. break;
  14. case 6:
  15. puts("six");
  16. done = 1;
  17. break;
  18. default:
  19. puts("other");
  20. break;
  21. } /* end-switch */
  22. } /* end-while */
  23. return 0;
  24. }
Success #stdin #stdout 0s 1792KB
stdin
1
9
2
6
2
stdout
one
other
two
six