Published
- 1 min read
c# swap variables
The solution for this is noted below
c# swap variables
Solution
//variables to swap
int i = 1;
int k = 2;
//one-liner to swap variables
(i, k) = (k, i);
Try other methods by searching on the site. That is if this doesn’t work