Solved

Suppose the Variables X and Y in the Following Bare

Question 12

Short Answer

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

Correct Answer:

verifed

Verified

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

Related Questions