How to swap two numbers

Can u please help me in thinking the logic