Question: Write a recursive function named multiply that takes two positive integers as parameters and returns the product of those two numbers (the result from multiplying
Write a recursive function named multiply that takes two positive integers as parameters and returns the product of those two numbers (the result from multiplying them together). Your program should not use multiplication - it should find the result by using only addition. To get your thinking on the right track:
7 * 4 = 7 + (7 * 3) 7 * 3 = 7 + (7 * 2) 7 * 2 = 7 + (7 * 1) 7 * 1 = 7 So, 7 * 4 = 7 + (7 + (7 + (7)))
The file must be named: multiply.py
code must be in python
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
