Ask Question
11 November, 18:35

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.

+4
Answers (1)
  1. 11 November, 18:41
    0
    The solution code is written in Python:

    i = 2 j = 3 itemp = i jtemp = j i = jtemp 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).
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Variables i and j each have associated values. Swap them, so that i becomes associated with j's original value, and j becomes associated ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers