#include <string.h>
void main(void)
{
int a=15,b=24;
printf("a=%d b=%d\n",a,b);
a=a^b;
b=b^a;
a=a^b;
printf("a=%d b=%d\n",a,b);
}
a=15 0000 1111 ^
b=24 0001 1000
0001 0111 =23
0000 1111 =15
0001 1000 =24
#include <string.h>
void main(void)
{
int a=15,b=24;
printf("a=%d b=%d\n",a,b);
a=a^b;
b=b^a;
a=a^b;
printf("a=%d b=%d\n",a,b);
}
a=15 0000 1111 ^
b=24 0001 1000
0001 0111 =23
0000 1111 =15
0001 1000 =24