Solved

Consider the Following Code Snippet for Recursive Addition

Question 47

Multiple Choice

Consider the following code snippet for recursive addition:
Int add(int i, int j)
{
// assumes i >= 0
If (i == 0)
{
Return j;
}
Else
{
Return add(i - 1, j + 1) ;
}
}
Identify the terminating condition in this recursive method.


A) if (i == 0)
B) return j
C) return add(i - 1, j + 1)
D) there is no terminating condition

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions