#include <stdio.h>
int main()
{
long i, k;
printf("Enter two integers \n");
scanf("%ld %ld", &i, &k);
printf("\n Before swapping i= %ld and k = %ld", i, k);
i = i ^ k;
k = i ^ k;
i = i ^ k;
printf("\n After swapping i= %ld and k = %ld", i, k);
return 0;
}
Enter two integers
35
96
Before swapping i= 35 and k = 96
After swapping i= 96 and k = 35
No comments:
Post a Comment