//variables to swap int i = 1; int k = 2; //one-liner to swap variables (i, k) = (k, i);
# swap variables x = 5 y = 10 x, y = y, x # In other languages you need a temp variable. # temp = a; # a = b; # b = temp;