This is very trivial stuff. Still I thought it could be helpful to someone.
Let two variables to swap be 'a' and 'b'
so,
step 1) a = a + b
step 2) b = a - b
step 3) a = a - b
Subscribe to:
Post Comments (Atom)
Hey guys hope this will be a little help to you. Lots of the stuff u will find here is what i got from Internet and manipulated.
2 comments:
in C in one statement u can do it as
a= a+b - (b=a);
was useful thx keep posting :)
Post a Comment