Given this piece of code

void swap(int x, int y)
{ x= x + y;
y= x - y;
x= x - y;
}

main ()
{ i = 1;
a[0]=2;
a[1]=1;
a[2]=0;
swap(i,a[i]);
printf("%d %d %d %d\n", i, a[0], a[1], a[2]);
swap(a[i], a[i])
printf("%d %d %d %d\n", i, a[0], a[1], a[2]);
return 0;
}

what will be printed out

hope some one can help

in main() the values of i and the elements of a remain unchanged since you are passing both parameters to swap() by value, not by reference.

You know of course that you will need to declare an array of int called a before you could successfully compile and run the code, yes?