MemorySwap

[code language=”csharp”] using System;

namespace MemorySwap
{
class Program
{
static void Main(string[] args)
{
int first=24, second=45;
Console.WriteLine("The value of first is {0} and second is {1}", first, second);

Swap(ref first, ref second);
Console.WriteLine("The new value of first is {0} and second is {1}", first, second);
}

static void Swap(ref int one, ref int two)
{
int temp;
//one = 12;
//two = 36;

temp = one;
one = two;
two = temp;
}
}
}
[/code]