Infosys Interview Question

write a code for swap program