Similar questions 2 more →
Recursion

Answer & solution
Answer: D (no official key was published)
1. Each invocation must read and retain its own character: ((c=getchar()) != '\n'). Recurse only for a non-newline character, then putchar(c) while unwinding.
2. This prints the input characters in reverse, option D. As written, the base invocation also prints the terminating newline before the reversed characters; main then prints a newline afterward.
3. A and B use getchar instead of output; C tests an uninitialized c. The source uses legacy implicit-int main; interpret the algorithm under its historical C conventions.