The answer would be either 4 or 20.
Let me tell you why basically Call by Copy/Restore is a special case of call-by-reference where the provided reference is unique to the caller. The final result of the referenced values will not be saved until the end of the function
The actual implementation of above program would be :
#include <stdio.h>
void f(int x, int y){
x--;
y=y+15;
}
int main(void)
{
int a = 5;
{
int cr_0000 = a; // Copy for first argument
int cr_0001 = a; // Copy for second argument
incr(&cr_0000, &cr_0001);
a = cr_0001; // Restore for second argument
a = cr_0000; // Restore for first argument
}
printf("%d\n", a);
return 0;
}
Now as you can see it depends on programmer which value he/she pick and thus answer would change accordingly.
Reference :https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_copy-restore