DEV Community

Discussion on: Swapping two numbers, w/o a temp variable

 
kebby profile image
Tammo 'kb' Hinrichs

I actually used this in real code once, in an assembly inner loop where I was really running out of registers :), but you're right of course.

Related question: Did anyone here ever have to reverse a string? :D

Thread Thread
 
hakash profile image
Morten Olsrud

Not in an interview, but in a quiz somewhere. It was an entry level one so only restriction was to not use the built in functions.