Trace the following algorithm. The book presents two ways to do tracing—a short form and a long form. To give you a head start, the setup for the short form and also the long form are given below. For your answer, pick one setup and use it. Skip the other setup.
1 set
yto 02 input
x3 while
xis not equal toy4 set
yto value ofx5 input
x6 set
xtox + y7 print
“x = ” x8 print
“y = ” y
Short-form setup: |
|
| ||||
input | x | y | output | |||
2 |
|
|
| |||
3 |
|
|
| |||
4 |
|
|
| |||
0 |
|
|
| |||
Long-form setup: |
| |||||
input |
|
|
| |||
2 |
|
|
| |||
3 |
|
|
| |||
4 |
|
|
| |||
0. |
|
|
| |||
line# | x | y | output | ||||
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.