Skip to content

Instantly share code, notes, and snippets.

@ahmedbr
Last active June 14, 2019 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmedbr/03c00fac0641aea2facc76c7ee4f7a51 to your computer and use it in GitHub Desktop.
Save ahmedbr/03c00fac0641aea2facc76c7ee4f7a51 to your computer and use it in GitHub Desktop.
int x = 10;
int y = 5;
Console.WriteLine("Before swapping: x = " + x + ", y = " + y);
x = x + y;
y = x - y;
x = x - y;
Console.WriteLine("After swapping: x = " + x + ", y = " + y);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment