UBS Interview Question: Two integers, A and B, swap t... | Glassdoor

Interview Question

Software Engineer Intern Interview

Two integers, A and B, swap their values without the use of

  a third variable.
Answer

Interview Answer

1 Answer

1

a=a+b;b=a-b;a=a-b;

Unknown on Mar 13, 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.