Question: Consider the algorithm: Algorithm Input: A natural number m and a natural number n ( 1 ) if n < m then return n (
Consider the algorithm:
Algorithm
Input: A natural number m and a natural number n
if n m then return n
repeat
a let n : n m
until n m
return n
What does the algorithm return when the input is n : and m :
What does the algorithm return when the input is n : and m :
What does the algorithm return when the input is n : and m :
What does the algorithm return when the input is n : and m :
What does the algorithm compute
A m n
B The difference of the sum of the first n natural numbers and m
Cmn
D The quotient of the division of n by m
E The remainder of the division of n by m
Fn m
G The greatest common divisor of m and n
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
