Explore BrainMass

Explore BrainMass

    Write a recursive algorithm

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Write a recursive algorithm to multiply two numbers.

    Mult(a,b) = a
    if b = 1
    if b > 1

    © BrainMass Inc. brainmass.com November 24, 2022, 11:33 am ad1c9bdddf

    Solution Preview

    if (b==1)
    <br> mult(a,b)=a;
    <br>if (b>1)
    <br> mult(a,b)=a + mult(a,(b-1))
    <br> =a + (a + ...

    Solution Summary

    This job helps to write a recursive algorithm.