What does this program print?

from C function pointers
C23 (GCC 13.3.0) beginner 2 min

What does this program print?

C
#include <stdio.h>

typedef int (*Operation)(int, int);

int add(int left, int right) { return left + right; }
int multiply(int left, int right) { return left * right; }

int main(void) {
    Operation current = add;
    printf("%d ", current(8, 2));
    current = multiply;
    printf("%d\n", current(8, 2));
}
Open in playground
Report an error