Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   swapping 2 numbers in a single statement (http://www.go4expert.com/forums/swapping-2-single-statement-t7425/)

deepneel25 21Nov2007 09:50

swapping 2 numbers in a single statement
 
Hi,
I need to know how can i swap 2 numbers which are stored in 2 variables in a single statement???.. I know that it can be done but i am not getting the logic correctly... Please help!!!!!

Salem 21Nov2007 13:44

Re: swapping 2 numbers in a single statement
 
Oh, you mean this pointless trick?
http://c-faq.com/expr/xorswapexpr.html


All times are GMT +5.5. The time now is 08:20.