Which of the following code segments correctly swaps the values of variables named x and y? a.

Question:

Which of the following code segments correctly swaps the values of variables named x and y?

a. x = y
y = temp
x = temp

b. temp = x
x = y
y = temp

c. x = y
temp = x
y = temp

d. temp = x
y = x
x = temp

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: