← Infosys questions

Swap Two Numbers Without Third Variable

Filed under Infosys · Also reported at GlobalLogic, Publicis Sapient, Tally Solutions, Visteon

Write a function to swap the values of two integer variables, a and b, without using a temporary third variable.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Infosys questions

Collected from public candidate posts and coding forums. Updated Nov 2026.