Here x[5] = { 1, 2, 3, 4, 5 }; means array x have 5 elements where 4th element is 5
now *ptr = (char*)(&x + 1) //
in (&x+1) ---> &x is the address of the ARRAY x. so (&x +1 ) adds the SIZE OF ARRAY x to &x. Which means it points to the location after the last element of x.
So ptr also points to that location.
Now , for this line *(x + 1), *(ptr - 1) ; //
*(x + 1) = 2 because x is the array and point to starting element of the array which is oth element , means 1. So x+1 = 2 which is 1st element of the array x . It prints 2 .
ptr is of type (char*). So (ptr-1) subtracts sizeof(char) from ptr. Hence (ptr-1) is the address of the last integer (which is 5)in the array. So *(ptr-1) is 5.
The minimum size for char is 8 bits or 1 byte .
That's why *(ptr - 1) points to 4th element of the array which is 5 and printing 5 .
The answer is 2,5 option C .