+ 3
changing value
a=10; b=20 not using new variable and changing a and b's value the result should be print(a,b) => 20 10 different method( a,b=b,a not using this) and it have to adapt for numbers
6 Réponses
+ 5
a = a+b;
b = a-b;
a = a-b;
+ 4
You could do this:
a = a + b
b = a - b
a = a - b
It does the trick
+ 3
@D_B your code works , no doubt.
But try to make one of the numbers 0 !!! Code will show error. That's why this method is not preferred.
+ 1
Works also:
https://code.sololearn.com/ctmeSDIQOX5J/?ref=app
0
Working on it :D