Tuesday, November 3, 2009

Lab 14

1. write a recursive function that asks for numbers (ending when the user types in a -1), and will print it in reverse order.

2. Use the STL stack data type, and use it to reverse a bunch of numbers, just as above.

3. Find the sum of the numbers 1 through 10, using recursion.

4. Write exp(x, n), and returns x ^ n;

No comments:

Post a Comment