Which of the following methods does NOT correctly swap the values of two variables x and y?

1
temp = x; x = y; y = temp;
2
x = x + y; y = x - y; x = x - y;
3
x = y; y = x;
4
All of the above

Sponsored

hivanix.in

Visit

This quiz is brought to you by hivanix.in

🌐 Web App Development

Quick Navigation