how to make java programme to swap no.s with or without using third variable
Answers
Answered by
1
U can swap 2 no.s without using 3rd variable like this
class abc
{
public void disp(int a,int b)
{
a=a+b;
b=a-b;
a=a-b;
}
}
class abc
{
public void disp(int a,int b)
{
a=a+b;
b=a-b;
a=a-b;
}
}
Similar questions