we have this --
1st iteration -- i = arr[0] ---> i=1
inside loop -- arr[i]=0 which means arr[1]=0 (as i is 1)
2nd iteration -- i= arr[1] ---> i=0 (as arr[1] was set to 0 in 1st iteration)
inside loop -- arr[i]=0 which means arr[0]=0 (as i is 0)
3rd iteration -- i= arr[2] ----> i=3
inside loop -- arr[i]=0 which means arr[3]=0 (as i is 3)
4th iteration -- i=arr[3]--- i=0 (as arr[3] was set to 0 in 3rd iteration)
inside loop -- arr[i]=0 which means arr[0]=0 (as i is 0)
so now we have, from above,
arr[0]=0
arr[1]=0
arr[3]=0
and arr[2] = 3 (from the original array)
so when we reprint the array elements , we get 0,0,3,0
wow , I am happy with myself that I cracked it
it was a tough one