APC-PRAC-009.c (293B)
1 /* WAP to swap two integer variable without using Third variable. */ 2 3 #include <stdio.h> 4 int main() 5 { 6 int a = 4, b = 6; 7 printf("Before swap : A = %d and B = %d", a, b); 8 a = a ^ b; 9 b = a ^ b; 10 a = a ^ b; 11 printf("\nAfter swap : A = %d and B = %d", a, b); 12 return 0; 13 }