Infosys interview question

write a code for swap program