DIR Return Create A Forum - Home
---------------------------------------------------------
ifaq
HTML https://ifaq.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: Simple logic/concept based questions
*****************************************************
#Post#: 3--------------------------------------------------
Swap without temporary variable
By: avinash.srin Date: August 25, 2011, 9:28 am
---------------------------------------------------------
Write code to swap the contents of two variables.
Challenge level 1: Don't use a temporary variable.
Once you finish coding this, try the next.
Challenge level 2: Do it in a single line (single expression) of
code.
#Post#: 5--------------------------------------------------
Re: Swap without temporary variable.
By: chandrabose.s Date: August 25, 2011, 9:32 am
---------------------------------------------------------
Challenge level 3: can you do it using bitwise operators ?
*****************************************************