You are given two functions already defined:
int square(int x) { return x * x; } int cube(int x) { return x * x * x; }
In main(), these functions are already called using a function pointer.
main()
Your task is to write the function:
void apply(int x, int (*op)(int))
op(x)
Example Input:
5 square
Output:
25
Input:
3 cube
27
Test Cases
Test Results
Input
Expected Output