Recursion

Answer & solution
Official answer: C
Our answer: C under ordinary finite-stack execution
1. Postdecrement in foo(val--) passes the old value, then decrements the caller’s local copy. Therefore foo(3) calls another foo(3), which calls another foo(3), without reaching a base case.
2. On conventional finite-stack execution, this unbounded recursion exhausts the stack and terminates abnormally. The exam uses that resource model; C does not prescribe a universal stack-overflow mechanism.
3. bar(val−1) passes a smaller value without modifying its caller. Calls descend 3,2,1,0, but bar(1) repeatedly calls bar(0) because its own val remains 1. It loops without return. Intended option C.