Swapping using call by value

Call by value :

In Call by value method, during function call only the actual values are passed as an argument to function. All changes are are firstly made to local function variables which are later reflected back in the variables from block in which it was invoked.

ALGORITHM

SWAP(x,y)

    1. SET temp=x
    2. SET x=y
    3. SET y=temp

C SOURCE CODE:

Leave a Reply

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