Swap without third variable

Question :

Swap two variables without using a third temporary variable

Program:

Explanation:
Here num1, num2 acts as a tuple. Since tuples are mutable, the above assignment works perfectly well

Output:

Leave a Reply

bodrum escort - eskişehir esc - mersin escort - mersin escort bayan - mersin esc