Show how to swap two numeric variables without using a third temporary variable. *It doesn't have to be in any specific language*
Anonymous
I had no clue how to do this as I haven't encountered a situation where I need this, so I said that I genuinely had no Idea. I mentioned the idea of using pointers but then said that that would be a third varible so I ignored it. I asked how to do it and he showed me this method. with varibles a and b a = a + b b = a – b a = a – b
Check out your Company Bowl for anonymous work chats.