/* MAT 4370 Mystery program: yet more bit fiddling + What does it do? + Can you explain how it works? + Can you supply a mathematical proof? */ #include int main(void) { int x, y; /* Prompt for and obtain two input values */ printf("Enter two integers: "); scanf("%d %d", &x, &y); /* Display values before the mystery action */ printf("BEFORE, x = %d y = %d\n", x, y); /* Perform a mysterious action */ x ^= y; y ^= x; x ^= y; /* Display values after mystery action */ printf(" AFTER, x = %d y = %d\n", x, y); return 0; }