Swap two variables in one line with out using temporary variable

a = a+b-(b=a)
OR
a = a^b^(b=a)

And both of them will work also for chars and stuff ….

Leave a Reply

Your email address will not be published. Required fields are marked *