Give the output of the recursive function below when called with an argument of 5.
```
void recursive( int i )
{
using namespace std;
if ( i < 8 )
{
i++;
recursive(i);
cout << i << " ";
}
}
```
a) 6 7 8
b) 5 6 7
c) 8 7 6
d) 7 6 5
e) None of the above. This is an infinite recursion if the function is called with argument 5.
c) 8 7 6
If this function is called with an argument of 5, the values of i that cause recursion are successively 5, 6, and 7, and each gets incremented to 6, 5, 8 which are stacked in that order.
You might also like to view...
What pattern can you see between the keyboard shortcuts for these functions:
a) Text Frame Options; b) Cell Options; and c) Table Options What will be an ideal response?
This has been a de-facto firewall program for a long time. It is a network packet filtering firewall program.
What will be an ideal response?
What question should be asked at the end of an interview?
A) "Are there any answers that you would like to change, now that you have had time to think things over?" B) "Others in your organization have provided conflicting information. Do we have your permission to explain your point of view?" C) "Do you mind if we check your answers out with others in future interviews?" D) "Is there anything we haven't touched on that you think is important for me to know?"
One of the most popular public key cryptosystems is a proprietary model named ____.
A. Triple DES B. Rijndael C. Rivest-Shamir-Aldeman (RSA) D. certificate authority (CA)