Introduction
The given below code swaps two given values of variables without using the third variable in C#.
namespace CDEMO.
{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();
}
}
}
Maitrey PatelPosted Oct 30, 2019, 7:29 AM
First = first * second; second = first / second; first = first / second;
Syed TalibPosted Mar 6, 2019, 8:14 AM
Hello please change your program