5. Modify the Factorial function of this chapter to print its parameter and returned value indented two spaces for each level of call to the function. The call Factorial(3) should produce the following output:
3
2
1
0
1
1
2
6
6. Write a recursive value-returning function that sums the integers from 1 through N.
7. Rewrite the following function so that it is recursive.
void PrintSqRoots( /* in */ int n )
{
int i;
for (i = n; i > 0; i--)
cout << i < ' ' << sqrt(double(i)) << endl;
}
8. The RevPrint function of this chapter prints the contents of a dynamic linked list in reverse order. Write a recursive function that prints the contents in forward order.
9. The Print function of this chapter prints the contents of an array from first element to last. Write a recursive function that prints from last element to first.