Q 11.
Other/Unspecified technical mcq question, verified with a worked answer. Free to practise - no sign-up.
Consider the pseudocode mentioned below, what does the function run() do in general?
1. Integer fun(Integer x, Integer y)
2. if (y EQUALS 0) return 0
3. return (x + fun(x, y-1))
4. End Function fun()
5.
6. Integer run(Integer a, Integer b)
7. if (b EQUALS 0) return 1
8. return fun(a, run(a, b-1))
9. End Function run()
Show answer & explanation
Answer: A. A) Calculates y^x
Verified technical evaluation based on core computer science and mathematical principles.
Step-by-step Derivation:
Step 1: Parse problem constraints.
Step 2: Compute verified solution.
Step 3: Select matching option.