Integer fun(int x, int y) if(x > 1) fun(x – 2, y + 2) end if print y End function fun()
Answers
Answered by
1
Answer:
if x= 4 and y=5:
Integer fun(int x, int y)
if(x > 1)
fun(x – 2, y + 2)
end if
print y
End function fun()
Explanation: the first reverse recursion would print 9 and returns to a previous function call, next it prints 7 and returns to the very first function call finally it prints a 5 and completes the execution.
MARK IN BRAINTLIST
Similar questions