This code ain't good. The values of the elements of a are unknown and could be anything, so the line is question is likely to access outside of the array.
Perhaps the line would be clearer if an intermediate variable was introduced:
1 2 3 4 5 6
for (int i=0; i<N; ++i)
{
int index = a[i] ;
a[i] = a[index] ;
printf("\nvalue is %3d ", a[i]) ;
}
when you print elements of the array in the first for, you will see:
20 19 18 17 16 ... 1
and then, when you do the first assignment a[i]=a[a[i]] in the second for, it's the same as if you write
a[0] = a[20] (because it takes value of zero element which is 20, and then use it as an index)
but maximal element number is 19 !!! 20th element holds unknown value