a[i]=i++;

this is undefined behavior...
the answer may change from compiler to compiler...try running the code on different compiler..

this is technically a sequence point...just go through the link and you will understand it better..
http://c-faq.com/expr/seqpoints.html