Answer:
Hence the answer is given as follows,
Explanation:
Base Case:- Â
If (num == 0) //This is the base case for the given recursive method Â
return 1; Â
If(num % 2!=0) checks whether num is odd. Â
The above condition is true for all odd numbers and false for even numbers. Â
if the remainder is not equal to zero when we divide the number with 2 then it is odd. Â
The method:- Â
The above recursive method calculates the product of odd numbers up to the given range(that is num) Â
For num=5 Â => 15(5*3*1). Â
For num=7 Â => 105(7*5*3*1). Â
For num=10 => 945(9*7*5*3*1).