#include <stdio.h>

void add(double a, double b) {
    printf("%.2f + %.2f = %.2f\n", a, b, a + b);
}

void subtract(double a, double b) {
    printf("%.2f - %.2f = %.2f\n", a, b, a - b);
}

void multiply(double a, double b) {
    printf("%.2f * %.2f = %.2f\n", a, b, a * b);
}

void divide(double a, double b) {
    if (b != 0) {
        printf("%.2f / %.2f = %.2f\n", a, b, a / b);
    } else {
        puts("Error: Division by zero.");
    }
}

int main(void) {
    void (*operations[4])(double, double) = {add, subtract, multiply, divide};
    int choice;
    double n1, n2;

    printf("Choose: 0 (Add), 1 (Subtract), 2 (Multiply), 3 (Divide): ");
    scanf("%d", &choice);

    if (choice >= 0 && choice <= 3) {
        printf("Enter two numbers: ");
        scanf("%lf %lf", &n1, &n2);
        (*operations[choice])(n1, n2);
    } else {
        puts("Invalid selection.");
    }
    return 0;
}