give me program coding for this prog plz

parthahir's Avatar, Join Date: Aug 2010
Newbie Member
how can i interchang any 2 numbers????
with out taking any variable?????
plz ans me its urjent
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
One way is to use the xor operation, although it doesn't always work:
Code:
a^=b;
b^=a;
a^=b;
You should find out under what circumstances it doesn't work (by testing that is, not by posting "give me coding plz" somewhere).
0
LordN3mrod's Avatar, Join Date: Sep 2010
Go4Expert Member
Yet another way is
a = a + b;
b = a - b;
a = a - b;