If you're writing a serious piece of software, please do not use tricks like the above to swap the values of variables. They are clever tricks, but nothing more than that. You gain nothing by using these tricks in any piece of software - it's not faster and doesn't use more memory than just using a temp variable.
Note that the above methods by adding / subtracting or multiplying / dividing don't work for all values. Integers can overflow, and dividing by zero leads to errors as well.
Yes, this stuff is all sorta kinda fun, but pointless.
Perhaps it was an interview question? If so, it doesn't say much for the interviewer. There are a small set of tricks like this, which people can easily learn for interviews, without actually knowing much about programming at all. Whereas many good honest candidates wouldn't know the answer, because they've been too busy working on real projects!
Interviewers should ask searching questions with longer answers, where it's much harder to fake a good answer. Of course, if the interviewer's own technical knowledge is lacking, and they're only looking for the "right" answer they've got on their crib-sheet, there's trouble there, too.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.<br /> <br />#:^P