Dry run the following code and draw the tree to show how recursion is solved. On writing only
output you will get zero number.
a) fun1(5)
void fun1(int n)
{
int i = 0;
if (n > 1)
fun1(n - 1);
for (i = 0; i < n; i++)
cout << " * ";
}
Output:
* * * * * * * * * * * * * * *
Recursion calls tree:
Comments
Leave a comment