How to swap two numbers without using a temporary variable ? | C # Program to swap two numbers without using temporary variable ; Code to swap ' x ' and ' y ' x now becomes 50 ; y becomes 10 ; x becomes 5
using System ; class GFG { static public void Main ( ) { int x = 10 ; int y = 5 ; x = x * y ; y = x / y ; x = x / y ; Console . WriteLine ( " After ▁ swaping : " + " ▁ x ▁ = ▁ " + x + " , ▁ y ▁ = ▁ " + y ) ; } }