Saturday, November 26, 2011

Easy-3


Work out the solution for this one, and i am sure many of you would have found out a new technique at the end of the solution !!

swap(int *e, int *f);
main()
{
int x=10,y=8;
swap(&x,&y);
printf("x=%d y=%d",x,y);
}
void swap(int *a, int *b)
{
*a ^= *b, *b ^= *a, *a ^= *b;
}

1 comment:

  1. Look at the tags.. If you are intelligent enough you will decipher the answer !
    Happy Coding :)

    ReplyDelete