Ask Question
30 September, 11:56

How many base cases are in the functionabove?

a. 0

b. 1

c. 2

d. 3

int func2 (int m, int n) {

if (n = = 0)

return 0;

else

return m + func2 (m, n-1);

}

+5
Answers (1)
  1. 30 September, 14:31
    0
    The answer is (b). 1.

    Explanation:

    In the code there is only 1 base case.

    the base case is as following:-

    if (n==0)

    return 0;

    this is the base case.

    Base case is the most important statement in the function that uses recursion because without base case the recursion calls will keep on going and we will get a run time error.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “How many base cases are in the functionabove? a. 0 b. 1 c. 2 d. 3 int func2 (int m, int n) { if (n = = 0) return 0; else return m + func2 ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers