Variables i and j each have associated values. Swap them, so that i becomes associated with j's original value, and j becomes associated with is original value. You can use two more variables itemp and jtemp.

Respuesta :

Answer:

The solution code is written in Python:

  1. i = 2
  2. j = 3
  3. itemp = i
  4. jtemp = j  
  5. i = jtemp  
  6. j = itemp

Explanation:

Given the i and j hold their respective values (e.g. 2 and 3) (Line 1-2). We can create another two more variables itemp and jtemp to hold the values of i and j (Line 3- 4). Next, we assign jtemp to i and itemp to j. This will enable the previous value of j assigned to i and previous value of i assigned to j (Line 5-6).