Okay, so I was in a lecture last week, and my teacher was talking about a question she got asked on the spot in a job interview. It's been bugging me ever since. It was something along the lines of;
Say you had two integer variables. How would you switch the values WITHOUT creating a temporary variable?
Can anyone figure out the solution? It's got something to do with arithmetic I believe.
Say you had two integer variables. How would you switch the values WITHOUT creating a temporary variable?
Can anyone figure out the solution? It's got something to do with arithmetic I believe.
