Doubt | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Doubt

someone please explain what the below expression means x,y=y,x

22nd Jan 2018, 1:12 PM
Thameem Jabir KJ
Thameem Jabir KJ - avatar
3 Answers
+ 9
It is the same as temp = x x=y y=temp nice and compact afterwards new x = the old y and new y = old x
22nd Jan 2018, 1:18 PM
Louis
Louis - avatar
+ 8
👍
22nd Jan 2018, 4:03 PM
Louis
Louis - avatar
+ 2
@Louis so it means just swaping of values. ryt?? ok thanks louis
22nd Jan 2018, 4:02 PM
Thameem Jabir KJ
Thameem Jabir KJ - avatar