int a = 1;
int b = 7;
void SwapTwoIntegers(int a, int b)
{
int temp = a;
a = b;
b = temp;
}
SwapTwoIntegers(a, b);
Console.WriteLine(a);
I was trying to write a function for swapping two variables, but it seems like i am going wrong somewhere in my code.