Solved

Suppose the Variables X and Y in the Following Bare

Question 30

Multiple Choice

Suppose the variables X and Y in the following Bare Bones program have the values 3 and 2,respectively,when execution begins.
 clear Z while X not 0: while Y not 0: decr Y incr Z incr Z decr X\begin{array} { l } \text { clear } \mathrm { Z } \\\text { while X not } 0 : \\\text { while } Y \text { not } 0 : \\\text { decr } Y \\\text { incr } Z \\\text { incr } \mathrm { Z } \\\text { decr } X\end{array}
What will be the value of Z when the program terminates?


A) 0
B) 1
C) 5
D) 6

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions