Here is recursive function. Identify the recursive case and the default case.
```
void recursive( int i ) //a)
{
if ( i < 8 ) //b)
{
i++; //c)
recursive(i); //d)
cout << i << " "; //e)
}
}
//f) The base case is not explicitly listed. If you choose this answer,
// then you must explain what the base case is.
```
The recursive case is line d), where the call to recursive with a larger
value of i . The other answer is f). The base case is not explicitly listed.
Explanation: The base case is the “do nothing” alternative of the if statement,
which is !(i == 8). This corresponds to i>=8. If you call the function with
arg 9, the base case is 9.
You might also like to view...
Which of the following mail clients is designed exclusively for the Macintosh platform?
a. Eudora b. Outlook c. Thunderbird d. Entourage
In a relational database, when two tables have a common field, the link between the tables is known as a hyperlink
Indicate whether the statement is true or false
A mutator is a method that is used to modify the internal contents of an object.
Answer the following statement true (T) or false (F)
Explain the importance of user accounts. What is the advantage of creating an account for each user of a computer? What is the role of the Administrator?
What will be an ideal response?