I am learning the C# language. I have tried one program, but I am getting too many errors during its code execution. Is anybody has the C sharp code to swapping number then please share with me.
I am learning the C# language. I have tried one program, but I am getting too many errors during its code execution. Is anybody has the C sharp code to swapping number then please share with me.
There two methods to swap the number
A)Using temp variable
int a, b;
Public static void Swap(a, b)
{
int temp
temp= a;
a= b;
a = temp;
}
B) Without using temp variable
int a, b;
{
a=a + b;
b=a – b;
a=a – b;
}
Bookmarks