Swap two numbers (one liner)
A=A+B-(B=A)
Swaps A and B.
Very short and sweet trick to swap two numbers.
Written by Ishan Jain
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#C
Authors
Related Tags
#c
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#