InterviewSolution
Saved Bookmarks
| 1. |
In the following algorithm x, y and z are variables which change their values in each step such that the value of the expression on the right hand side is assigned to the variable on the left hand side of the equation. Each cycle consists of 5 steps, S_(1), S_(2), S_(3).... are the sum of each corresponding cycle 1, 2, 3....... START Step 0. x=1, y=-2, z=3 Step 1. x=y-z Step 2. y=z-x Step 3. z=x-y Step 4. S=x+y+z Step 5. Go to step 1. Which one of the following is correct for each cycle? |
|
Answer» `S=2x` |
|