Monday, April 12, 2010

Lab and homework #13

1) Using recursion, find the product of the digits of an integer.

2) Using iteration (= a loop), find the product of the digits of an integer.

3) Using iteration and using recursion, write a function which will find the sum of the numbers I through K.

4) You have a recursive reverse function. Write a recursive forward function which will print all the digits in the forward order. (So, 123 would print 123, by printing a 1, then a 2, then a 3.)

No comments:

Post a Comment