The exact implementation of the course depends on the programming language you are using, but check out XOR swap .
An example in C might be
#include <stdio.h>
void swap(int* a, int* b)
{
*a = (*a)^(*b);
*b = (*a)^(*b);
*a = (*a)^(*b);
}
int main(int argc, char** argv)
{
int a = 4;
int b = 7;
printf("a=%d, b=%d\n", a, b);
swap(&a, &b);
printf("a=%d, b=%d\n", a, b);
return 0;
}
:. , , , , , , . .