krisrajz
Friday, October 02, 2009
Swap value of two variables without using third variable(.NET)
int a, b;
a = 10;
b = 20;
Console.WriteLine("Before Swapping a="+a+" b="+b);
a = a + b;
b = a - b;
a = a - b;
Console.WriteLine("After Swapping a=" + a + " b=" + b);
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment