Question: Consider the algorithm: Algorithm Input: A non-negative Integer n (1) n=0 then return 1 (2) let c:=1 (3) let i:=0 (4) repeat - (a) let
Consider the algorithm: Algorithm Input: A non-negative Integer n (1) n=0 then return 1 (2) let c:=1 (3) let i:=0 (4) repeat - (a) let i:=i+1 - (b) let c:=c.(-4) (5) until i =n (6) return c What does the algorithm return when the input is n=1? What does the algorithm return when the input is n = 4? What does the algorithm return when the input is n= 6? What does the algorithm return ? O A. The remainder of the division of n by -4. OB.(-4)" C. The difference of the first n natural numbers and -4. D. The greatest common divisor of -4 and n OE. -n-4 OF (-4). n
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
