Q. What will be the output of the following code?
Code:#include <stdio.h>
int main() {
int a = 10, b = 20;
a = a ^ b;
b = a ^ b;
a = a ^ b;
printf("%d %d", a, b);
return 0;
}
β
Correct Answer: (B)
20 10
Explanation: This code swaps a and b without using a temporary variable.