Description
Please do this in your pairs.
-
Write a recursive function named product that takes two parameters m and n, both integers. The function should return the product of all the numbers between m and n inclusive. For example, the function call product(5, 3) should return 60, because 3 x 4 x 5 = 60. You may not make any assumptions about the values or order of the two parameters. If m and n are the same, return m (or n, since they are the same).
-
Write a recursive function named findMaxInList that takes a linked list of ints and returns the largest int in that list. (Assume that it won’t be an empty list.)
-
Write a recursive function named sumEvens that takes a linked list of ints and returns the sum of only the even numbers in the list.