Cognizant Interview Question

The logic of Swap two number