Fiserv interview question

Swap two variables without using a third variable.

Interview Answer

Anonymous

14 Jun 2018

class Program { static void Main(string[] args) { int first,second ; first = 1; second = 2; first = first + second; second = first - second; first = first - second; Console.WriteLine(first.ToString()); Console.WriteLine(second.ToString()); Console.ReadLine(); } } }