In this tutorial, we will swap two numbers using XOR( ^ ) operator. Before solving the solution, let’s examine what is a bitwise XOR operator. A bitwise XOR compares corresponding bits of two operands and returns 1 if...
Tag - C# program to swap two numbers
C# program to swap two numbers
This C# program swaps two numbers using a temporary variable. To swap numbers without using extra variable see another code below. Variables are defined in the first row. In the next lines, values are assigned to these variables...