ContactUs :

Please send your Questions & Answers or Feedback to "mohan@javabook.org"

How can I swap two variables without using a third variable?

Add two variables and assign the value into First variable. Subtract the Second value with the result Value. and assign to Second variable. Subtract the Result of First Variable With Result of Second Variable and Assign to First Variable. Example:

int a=5,b=10;a=a+b; b=a-b; a=a-b;

 

Related Posts Plugin for WordPress, Blogger...
Flag Counter