Question: The following is the algorithm for multiplying two integers m and n `a la Russe 1. get m, n 2. set product to 0 3.
The following is the algorithm for multiplying two integers m and n `a la Russe 1. get m, n 2. set product to 0 3. repeat until m < 1 4. if m is odd set product to product + n 5. set m to m div 2 6. set n to n + n 7. end repeat 8. print product where div represents the integer division of the first number by the second. Trace the above algorithm for m = 49, n = 5 (show the values of all the variables m, n, product, for each iteration of the repeat loop).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
