Answers for "swapping two numbers without third variable"

C
4

swap 2 numbers without using 3rd variable

a=10;
b=20;
a=a+b;//a=30 (10+20)    
b=a-b;//b=10 (30-20)    
a=a-b;//a=20 (30-10)
Posted by: Guest on May-16-2021
1

swapping without third variable use

x = x + y
y = x - y
x = x - y
Posted by: Guest on June-10-2021

Code answers related to "swapping two numbers without third variable"

Code answers related to "C"

Browse Popular Code Answers by Language