Login or Create an Account to view the mark scheme, comment, and add to a test
Given the nested loop below, state the range of all possible values for n and m such that, if and when the variable k is equal to the number 7 or the number 9, both loops will immediately stop iterating.
function escape
i = 0
j = 0
k = 0
loop while i < 4
i = i + 1
k = 2 * k
loop while j <= 3
j = j + 1
k = k + 1
if k = 7 or k = 9 then
i = n
j = m
end if
end loop
j = 0
end loop
end function
(a).
n >= 4, m > 4
(b).
n >= 4, m >= 4
(c).
n > 4, m >= 4
(d).
n > 4, m > 4
Multiple Choice1 MarkPremium
0 Uses0 Views0 Likes