Need a one line code to swap numbers
Generally we write the code using temp or by using the same variables declared to swap two numbers but i just need one line code to solve this can any one post me that
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dorababu MekaPosted May 26, 2011, 6:21 AM
a = 10;
b = 20;
a = b + a - (b = a);
textBox1.Text = a.ToString();
textBox2.Text = b.ToString();
ChaitanyaPosted May 26, 2011, 10:31 AM