Computer Science, asked by Abhisekkumar, 1 year ago

Swaping of two number without using third variable in Java

Answers

Answered by sugarpie11
3
hey friend!!
i'll tell u how to swap two numbers without using third variable in java,

class swap
{
public void accept (int a,int b)
{
a= a+b;
b=a-b;
a=a-b;
system.out.println("the swapped value of a is" +a)
system.out.println("the swapped value of b is" +b)
}
}

Hope it helps!!
plz mark it a brainlist answer
Similar questions