diff options
| author | pants <niklasjo2004@gmail.com> | 2026-09-21 14:17:45 -0700 |
|---|---|---|
| committer | pants <niklasjo2004@gmail.com> | 2026-09-21 14:17:45 -0700 |
| commit | a33d49ac4d1ce554c72770927957a089b4023bf1 (patch) | |
| tree | 17ea036b5a0e8b488dc236f0ce48a275ecd80ef8 /c/playlist.c | |
Diffstat (limited to 'c/playlist.c')
| -rw-r--r-- | c/playlist.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/c/playlist.c b/c/playlist.c new file mode 100644 index 0000000..42c7ced --- /dev/null +++ b/c/playlist.c @@ -0,0 +1,38 @@ +#include <stdio.h> +#include <stdbool.h> + +int main() { + bool running = true; + while (running) { + + // Print menu options + printf("Welcome to the text-based menu!\n"); + printf("1. Option 1\n"); + printf("2. Option 2\n"); + printf("3. Option 3\n"); + printf("4. Exit\n"); + + // Get user input + int option; + scanf("%d", &option); + + // Handle user input + switch (option) { + case 1: + printf("You chose option 1!\n"); + break; + case 2: + printf("You chose option 2!\n"); + break; + case 3: + printf("You chose option 3!\n"); + break; + case 4: + running = false; + printf("You chose to exit the menu.\n"); + break; + default: + printf("Invalid input. Please try again.\n"); + } + } +} |
