frozengirl309 frozengirl309
  • 03-07-2019
  • Computers and Technology
contestada

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

Respuesta :

SerenaBochenek SerenaBochenek
  • 14-07-2019

Answer:

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.

Answer Link

Otras preguntas

According to emerson, how do we feel after we have worked hard for a goal? a. angry and cheated c. annoyed and tired b. relieved and happy d. despairing and
How are grouping symbols helpful in simplifying expressions correctly
To the nearest millions, how big is asia in square miles
where does a taxpayer get each of the following
does the niagra falls noise level quiet down in the winter??
Adolf Hitler was a native of which nation?
What is the surface area of the figure? a 428 ft² b 560 ft² c 632 ft² d 888 ft²
in a school libary ,52% of the books are paper.if there are 2,658 books in the libary, how many of them are not paperback to the nearest whole number
The radius of the circular car tire is 12.5 inches find the circumference use 3.14 for pi
Need help with this problem. Help me please!