[C] exchange two numbers of content
Allow creating temporary variables
# Include <stdio. h> int main () {int a = 2, B = 5; int temp = 0; temp = a; a = B; B = temp; printf ("% d, % d \ n ", a, B); return 0 ;}
2. Temporary variables cannot be created. ①. Addition implementation
# Include <stdio. h> int main () {int a, B; printf ("enter two numbers:"); scanf ("% d, % d", & a, & B ); a = a + B; B = a-B; a = a-B; printf ("% d, % d \ n", a, B); return 0 ;}
②. Multiplication
# Include <stdio. h> int main () {int a, B; printf ("enter two numbers:"); scanf ("% d, % d", & a, & B ); a = a * B; B = a/B; a = a/B; printf ("% d, % d \ n", a, B); return 0 ;}
③. The logical "^" refers to "exclusive or" (converted to binary)
# Include <stdio. h> int main () {int a, B; printf ("enter two numbers:"); scanf ("% d, % d", & a, & B ); a = a ^ B; B = a ^ B; a = a ^ B; printf ("% d, % d \ n", a, B); return 0 ;}