summaryrefslogtreecommitdiff
path: root/c/switch.c
diff options
context:
space:
mode:
authorpants <niklasjo2004@gmail.com>2026-09-21 14:17:45 -0700
committerpants <niklasjo2004@gmail.com>2026-09-21 14:17:45 -0700
commita33d49ac4d1ce554c72770927957a089b4023bf1 (patch)
tree17ea036b5a0e8b488dc236f0ce48a275ecd80ef8 /c/switch.c
Diffstat (limited to 'c/switch.c')
-rw-r--r--c/switch.c29
1 files changed, 29 insertions, 0 deletions
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 <stdio.h>
+
+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;
+}
+}