Ask Question

Give a recursive (or non-recursive) algorithm to compute the product of two positive integers, m and n, using only addition and subtraction?

+4
Answers (1)
  1. 5 October, 17:09
    0
    Multiply (m, n)

    1. Initialize product=0.

    2. for i=1 to n

    3. product = product + m.

    4. Output product.

    Explanation:

    Here we take the variable "product" to store the result m*n. And in this algorithm we find m*n by adding m, n times.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Give a recursive (or non-recursive) algorithm to compute the product of two positive integers, m and n, using only addition and subtraction? ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers