Re: [algogeeks] Swapping two variables without using a temporary variable

2011-06-14 Thread tech rascal
@sunny... yeah sorry, m stupid..:) thanx On Tue, Jun 14, 2011 at 10:52 AM, sunny agrawal sunny816.i...@gmail.comwrote: @tech rascal 10 = 01010 20 = 10100 -- xor = 0 = 30 why r u getting 1 ?? On Tue, Jun 14, 2011 at 2:28 AM, Supraja Jayakumar

Re: [algogeeks] Swapping two variables without using a temporary variable

2011-06-14 Thread Lego Haryanto
Have you tested your claim regarding overflow/underflow and proved it is indeed a problem, or you just thought that it won't work? Using two's complement, it should still work. On Friday, June 10, 2011, Wladimir Tavares wladimir...@gmail.com wrote: Swapping two variables without using a

RE: [algogeeks] Swapping two variables without using a temporary variable

2011-06-14 Thread umesh kewat
variables without using a temporary variable @Wladimir: Can you kindly explain the overflow and underflow you mentioned. Thanks Supraja J On Fri, Jun 10, 2011 at 9:58 PM, Wladimir Tavares wladimir...@gmail.comwrote: Swapping two variables without using a temporary variable using the + and -: x

Re: [algogeeks] Swapping two variables without using a temporary variable

2011-06-13 Thread Supraja Jayakumar
@Wladimir: Can you kindly explain the overflow and underflow you mentioned. Thanks Supraja J On Fri, Jun 10, 2011 at 9:58 PM, Wladimir Tavares wladimir...@gmail.comwrote: Swapping two variables without using a temporary variable using the + and -: x = a; y = b; x = x + y / / x = a + b;

Re: [algogeeks] Swapping two variables without using a temporary variable

2011-06-13 Thread sunny agrawal
@tech rascal 10 = 01010 20 = 10100 -- xor = 0 = 30 why r u getting 1 ?? On Tue, Jun 14, 2011 at 2:28 AM, Supraja Jayakumar suprajasank...@gmail.com wrote: @Wladimir: Can you kindly explain the overflow and underflow you mentioned. Thanks Supraja J On Fri, Jun 10,