## Variable SwitchLogic puzzles require you to think. You will have to be logical in your reasoning.You're a computer programmer, and the program you're writing has numeric variables A and B. You need the computer to switch the variables so that the number in variable A becomes variable B, and the number in variable B becomes variable A. Adding a third variable would use more memory though, so how can you do that switch without using another variable? Use commands such as B=B-A to assign a new value to B.
## What Next?
Tweet
See another brain teaser just like this one...Or, just get a random brain teaser If you become a registered user you can vote on this brain teaser, keep track of which ones you have seen, and even make your own. Back to Top |

## Follow Braingle!