summaryrefslogtreecommitdiff
path: root/c/switch.c
diff options
context:
space:
mode:
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;
+}
+}