Answer to Question #294052 in Algorithms for Moon

Question #294052

Write an algorithm which multiplies two numbers using the minimum number of additions.


1
Expert's answer
2022-02-07T12:50:51-0500
Stat function multiply(firstnum,secondnum):
    if secondnum = 0 then
        return 0
    else 
       return firstnum + multiply(firstnum, secondnum-1)
    end if
Stop

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS