How many times will the following function call itself, if 5 is passed as the argument? void showMessage(int n)
{
If (n > 0)
{
Cout << "Good day!" << endl;
ShowMessage(n - 1) ;
}
}
A) 1
B) 4
C) 5
D) An infinite number of times
Correct Answer:
Verified
Q2: Indirect recursion means that a function calls
Q5: Any algorithm that can be coded with
Q7: When a recursive function directly calls itself,
Q8: A recursive function cannot call another function.
Q10: When function A calls function B which,
Q11: A recursive function that does not have
Q12: The recursive factorial function calculates the factorial
Q12: The _ of recursion is the number
Q15: The programmer must ensure that a recursive
Q24: The QuickSort algorithm is used to sort
A)
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents