void main()
should be
int main()
Return type of main is int.
Edit:
After analyzing the code, it seemed to be that you should be doing the XOR in a bottom-up order in the last loop. Basically, you're printing the answer in reverse.
so:
for(i=0;i<4;i++)
should be:
for(i=3;i>=0;i--)