PDA

View Full Version : Re: [LF] swaping


Lahey Support
08-15-2003, 01:19 AM
Hi, what about a sequence like this:

A = A - B
B = B + A
A = B - A ?

It's variable type independent.

Jacek Magiera,
Division of Computational Mechanics
Cracow University of Technology
Cracow, POLAND


"Al Salamah, Muhammad" wrote:
>
> Hi there
> I and most of the people I work with face the problem of swapping the
> values of two variables without ever needing a third variable. Can any body
> offer a solution. Thanks.
>
> ************************************************
> ************************************************
> ** Muhammad Al Salamah **
> ** KFUPM **
> ** Box 382 **
> ** Dhahran 31261 **
> ** Saudi Arabia **
> ** Phone No.: Residence +(966)38606045 **
> ** Office +(966)38602541 **
> ************************************************
> ************************************************