Question: Consider the algorithm: Algorithm Input: A natural number q and a natural number m with q > m . ( 1 ) repeat - -
Consider the algorithm:
Algorithm
Input: A natural number
q
and a natural number
m
with
q
m
repeat
a let
r
:
q
mod
m
b let
q
:
m
c let
m
:
r
until
r
return
q
What does the algorithm return when the input is
q
:
and
m
:
What does the algorithm return when the input is
q
:
and
m
:
What does the algorithm return when the input is
q
:
and
m
:
What does the algorithm return when the input is
q
:
and
m
:
What does the algorithm return
A The remainder of the division of
q
by
m
B
m
q
C The greatest common divisor of
m
and
q
D The quotient of the division of
q
by
m
E
m
q
F
m
G
q
m
H The difference of the sum of the first
q
natural numbers and
m
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
