swapping two numbers
int b = 9;
swapping needs
int temp = a;
a= b;
b= temp;
Problem: how to avoid using an extra variable temp?
b = a-b; // a==17 b=17-9=8
a = a-b; // a==17-8=9 b==8
b = b+a; // a==-1 b=9+(-1)=8
a = b-a; // a==8-(-1)=9 b==8
OR
a= a*b; // a==8X9=72 b==9
b= a/b; // a==72 b=72/9=8
a= a/b; // a==72/8=9 b==8
OR
a=a/b;..
......
......
OR
a= a^ b;...
b=log......
..........
OR
......
.......
.......