From a33d49ac4d1ce554c72770927957a089b4023bf1 Mon Sep 17 00:00:00 2001 From: pants Date: Mon, 21 Sep 2026 14:17:45 -0700 Subject: init --- c/switch.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 c/switch.c (limited to 'c/switch.c') diff --git a/c/switch.c b/c/switch.c new file mode 100644 index 0000000..46d1cf9 --- /dev/null +++ b/c/switch.c @@ -0,0 +1,29 @@ +#include + +enum options { + STOP = 'q', + CONTINUE = 'c', + NEW = 'n', +}; + + + +int main() { + char optbuff[4]; + + while (optbuff[0] != STOP) { + printf("choose sumth"); + scanf("%4s", optbuff); + + switch (optbuff[0]) { + case STOP: + printf("stop\n"); + break; + case CONTINUE: + printf("continue\n"); + break; + break; + } + return 0; +} +} -- cgit v1.2.3