How to use swap function in C programming
In C, a function can be passed argument by value to function, but it cannot change the value in the variable. It’s a concept of “Pass by Values”. It’s only copies of the actual parameter’s value in program memory.
The below swap example demonstrates how the swap routine only change the copies of the variable x & y, but not the original variables.