Skip to content

Instantly share code, notes, and snippets.

@nesffer
Last active June 21, 2018 15:07
Show Gist options
  • Save nesffer/8723baca87e856fea5cc6586648dac20 to your computer and use it in GitHub Desktop.
Save nesffer/8723baca87e856fea5cc6586648dac20 to your computer and use it in GitHub Desktop.
int a = 10;
int b = 20;
printf("XOR 전: %d, %d\n", a, b); // XOR 전: 10, 20
a = a ^ b;
b = a ^ b;
a = a ^ b;
printf("XOR 후: %d, %d\n", a, b); // XOR 후: 20, 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment