Which of the following code segments can be used to update the values of the variables as shown in the table?
A
temp ← word1
word3 ← word1
word1 ← temp
B
temp ← word1
word1 ← word3
word3 ← temp
C
temp ← word1
word1 ← word2
word3 ← temp
D
temp ← word3
word1 ← word2
word2 ← temp