Function that swap two numbers
Hi i need a function that swap 2 numbers I have written code below but it seems to doesn't work. Where am I wrong?
(int, int) Swap(int first, int second)
{
int temp = first;
first = second;
second = temp;
return (first, second);
}
int a = 5;
int b = 10;
Console.WriteLine(a);
Console.WriteLine(b);
Swap(a, b);
Console.WriteLine(a);
Console.WriteLine(b);