+ 2
Code to swap two number's without using 3rd variable in java
4 Réponses
+ 5
int a=5;
int b=7;
a=a+b;
b=a-b;
a=a-b;
System. out.print(a);
+ 23
In many ways it can be achieved
//u just need to think urself , u can use * & / also ... but also be careful bcz a,b can be 0 also☺
+ 11
int a=10,b=20;
System.out.println("A ="+a+" and "+"B= "+b);
a=a^b;
b=a^b;
a=a^b;
System.out.println("after swapping A ="+a+" and "+"B= "+b);
by this you can swap two numbers
0
my answer is easy and right