First time here? Checkout the FAQ!
x
menu search
brightness_auto
more_vert

Exchange the value of $a=20 & $b=30 this variables without creating any new variable ?


$a=20;$b=30;
thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

1 Answer

more_vert
 
verified
Best answer

You can create logic like this


b=a+b (50)

a=b-a (50-20=30)


b=b-a (50-30=20)



'

$b=$a+$b;
$a=$b-$a;
$b=$b-$a;

'

thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
more_vert

Amazingggggg , which language should i learn first ?

...