Ask Question
17 September, 23:38

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

+3
Answers (1)
  1. 18 September, 03:28
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers