Problem: Swap two numbers without using any third variable in C.

Method 1: Swap using Addition and Subtraction Operator

Method 2: Swap using Multiplication and Division Operator

Method 3: Swap using XOR Operator

^ – XOR Operator

These are some of the methods using which we can swap two numbers without any third variable.

Leave a Reply