Two Variable swapping program in C/C++
#include<stdio.h>
int main() {
int a, b;
printf(“\nEnter First Number : “);
scanf(“%d”, &a);
printf(“\nEnter Second Number : “);
scanf(“%d”, &b);
a = a ^ b; b = a ^ b; a = a ^ b;
printf(“\n a = %d and b = %d”, a, b);
return(0);
}

Leave a reply