Monday, 7 September 2015

Swap two numbers without using any third variable and arithmetic operator.


Swap two numbers without using any third variable and arithmetic operator.


int a =10,int b=20;

a= a b;
b= a-b;
a= a-b;
Or


x = x * y; 
y = x / y; 
x = x / y;

No comments:

Post a Comment