This repository has been archived on 2021-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
sys_prog/swap.c

15 lines
170 B
C
Raw Normal View History

2019-09-27 07:58:45 +00:00
#include <stdio.h>
void swap(int* a, int* b) {
*a = *a ^ *b;
*b = *b ^ *a;
*a = *a ^ *b;
}
int main() {
int a = 3, b = 5;
swap(&a, &b);
printf("%d %d", a, b);
}