Ask Question
28 June, 07:51

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. 28 June, 10:54
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers