Answer:
ANSWER = 16
COUNTER = 1
Explanation:
a. COUNTER = 0
b. ANSWER = 100
c. ANSWER = 100/2 = 50
d. ANSWER (50) is even, so it goes back to (c)
ANSWER = 50/2 = 25
and
COUNTER = COUNTER + 1 = 0 + 1 =1
ANSWER is now odd (25), so it moves to (e)
e. f and g will be executed as follows.
f. ANSWER = ANSWER + COUNTER = 25 + 1 = 26
g. COUNTER = COUNTER+1 = 1 + 1 = 2.
COUNTER is not greater than 3, so f & g will be executed again
f. ANSWER = 26 + 2 = 28
g. COUNTER = 2 + 1 = 3.
And again
f. ANSWER = 28 + 3 = 31
g. COUNTER = 3 + 1 = 4
Now, execution will proceed to h
h. i and j will be executed as follows
i. ANSWER = ANSWER - 5 = 31 - 5 = 26
j. COUNTER = COUNTER - 1 = 4 - 1 = 3
COUNTER ≥ 2, so it'll be executed again
i. ANSWER = 26 - 5 = 21
j. COUNTER = 3 - 1 = 2
And again...
i. ANSWER = 21 - 5 = 16
j. COUNTER = 2 - 1 = 1
Now, the condition is no longer valid.
So, execution proceed to k
k. The displayed values of ANSWER and COUNTER is 16 and 1, respectively.