#include <stdio.h>
int main() {
int i = 100;
int k = 121;
printf(" value of i=%d k=%d before swapping", i, k);
i = i ^ k;
k = i ^ k;
i = i ^ k;
printf("value of i=%d k=%d after swapping", i, k);
return 0;
}
Thursday, 25 January 2018
C program to swap two numbers using bitwise operators
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment