NVR Interview Question: X = 1. Y = 2. Switch the valu... | Glassdoor

Interview Question

Applications Lead Interview Reston, VA

X = 1. Y = 2. Switch the value between these variables

  without using another variable.
Answer

Interview Answer

2 Answers

0

The interviewer admitted this was a trick question because only statistical programmers can usually answer it.

Interview Candidate on Aug 20, 2015
0

y => y + x (3)
x => y - x (2)
y => y - x (1)

Jenny on Nov 28, 2016

Add Answers or Comments

To comment on this, Sign In or Sign Up.