#include <stdio.h>

#define ADD 1
#define SUB 2
#define MUL 3
#define DIV 4

int main(void) {
    double a, b;
    int op;

    printf("Input first number: ");
    scanf("%lf", &a);
    printf("Input second number: ");
    scanf("%lf", &b);

    printf("Select Operation:\n"
           "[1]: Addition\n"
           "[2]: Subtraction\n"
           "[3]: Multiplication\n"
           "[4]: Division\n"
           "> ");
    scanf("%d", &op);

    switch (op) {
        case ADD:
            printf("ANS: %lf\n", a + b);
            break;
        case SUB:
            printf("ANS: %lf\n", a - b);
            break;
        case MUL:
            printf("ANS: %lf\n", a * b);
            break;
        case DIV:
            if (b == 0.0) {
                puts("Zero Division");
                return 1;
            }
            printf("ANS: %lf\n", a / b);
            break;
        default:
            puts("Undefined Operation");
            return 1;
    }

    return 0;
}
