Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

swap two numbers without third variable

int a=4;
int b=5;
a=a+b; // 4 + 5 = 9
b=a-b; // 9 - 5 = 4
a=a-b; // 9 - 4 = 5
 
PREVIOUS NEXT
Tagged: #swap #numbers #variable
ADD COMMENT
Topic
Name
4+1 =