/*
    LOOP PRACTICE - Simple menu (do-while)
    --------------------------------------
    Use do-while so we show the menu at least once, then
    repeat until user chooses 0 to exit.
    Option 1: print "Hello!"
    Option 2: print "Bye!"
    Option 0: exit
*/

#include <stdio.h>

int main(void) {
    int choice;

    do {
        printf("\n--- Menu ---\n");
        printf("1. Say Hello\n");
        printf("2. Say Bye\n");
        printf("0. Exit\n");
        printf("Your choice: ");
        scanf("%d", &choice);

        if (choice == 1) {
            printf("Hello!\n");
        } else if (choice == 2) {
            printf("Bye!\n");
        } else if (choice == 0) {
            printf("Goodbye!\n");
        } else {
            printf("Invalid. Try 0, 1 or 2.\n");
        }
    } while (choice != 0);

    return 0;
}
