LogiQuest
Back to Functions
17

What will be the output of the program?

#include <stdio.h>
int apply(int (*f)(int), int x) { return f(x); }
int twice(int x) { return 2 * x; }
int main(void) {
    printf("%d\n", apply(twice, 21));
    return 0;
}
Medium

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.