Ask Question
31 May, 12:49

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

+1
Answers (1)
  1. 31 May, 16:00
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers