The integer variables m and n are assigned the values 3 and 8, respectively, during the execution

Question:

The integer variables m and n are assigned the values 3 and 8, respectively, during the execution of a program (written in pseudocode). Each of the following successive statements is then encountered during program execution. [Here the values of m, n following the execution of the statement in part (a) become the values of m, n for the statement in part (b), and so on, through the statement in part (e).] What are the values of m, n after each of these statements is encountered?
(a) if n - m = 5 then n : = n - 2
(b) if ((2 * m = n) and (⌊n/4⌋ = 1)) then
n : = 4 * m - 3
(c) if ((n < 8) or (⌊m/2⌋ = 2)) then n : = 2 * m
else m : = 2 * n
(d) if ((m < 20) and (⌊n/6⌋ = 1)) then
m : = m - n - 5
(e) if ((n = 2 * m) or (⌊n/2⌋ = 5)) then
m : = m + 2
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: