Question: Write a function recursive_divison() that accepts num1 and num2 as input parameters (both integers) and performs division through recursive subtraction. num1 is the dividend (the

Write a function recursive_divison() that accepts num1 and num2 as input parameters (both integers) and performs division through recursive subtraction. num1 is the dividend (the number you are dividing) and num2 is the divisor (the number you are dividing by). The function should return the quotient (the result of the division). Precondition: num1 is evenly divisible by num2. Bonus: assume there is no precondition and return both the quotient and the remainder; remember that you cannot execute two return statements in a function. Hint: recall recursive multiplication through addition.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!