52.4k views
0 votes
Implement in a programming language of your choice the void function swap( a, b ) that exchanges the values of 2 passed actual int parameters a and b. State which language you select. Actual parameters a and b are 2 distinct addressable programming objects (variables).

1 Answer

6 votes

Answer:

Javascript.

function swap(a, b) {

a = b;

b = a;

// can you explain more, aka for what to return

}

Step-by-step explanation:

User Daniel Llano
by
4.2k points