Swap two variables in one line with out using temporary variable vamsipavan October 6, 2006 a = a+b-(b=a) OR a = a^b^(b=a) And both of them will work also for chars and stuff ….