Question: Which function correctly encodes the multiplication of 2 positive numbers a and b recursively? ( i . e . mult ( a , b )

Which function correctly encodes the multiplication of 2 positive numbers a and b recursively? (i.e. mult(a,b) should return the numerical equivalent of a*b.) Hint: Recall that multiplication is repeated addition.
Group of answer choices
def mult(a, b):
if (b ==1):
return b
else:
return b + mult(a-1, b)
def mult(a, b):
if (a ==1):
return 1
else:
return b + mult(a-1, b)
def mult(a, b):
if (a ==1):
return b
else:
return b + mult(a-1, b)
def mult(a, b):
if (a ==1):
return a
else:
return b + mult(a-1, b)

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 Programming Questions!