Monday, July 14, 2008

SWAP NOs USING BITWISE

#include
main()
{
int a,b;
printf("ENTER VALUES FOR a and b\n");
scanf("%d%d",&a,&b);
printf("a is %d\n",a);
printf("b is %d\n",b);
a=a^b;
b=a^b;
a=a^b;
printf("a is%d\n",a);
printf("b is%d\n",b);
}

No comments:

Post a Comment