Zebra0.com

java ifelseSwap variables to put in order

Swap variables to put in order

This program inputs two numbers and swaps them if they are not in order. A swap is a very common task in programming. Notice that you always need an extra variable to perform the swap.