The answer depends on the Endianness of the system.
a = 10 , and let &a = 1000
Byte 1003: 00001010 (Little Endian) or 00000000 (Big Endian)
Byte 1002: 00000000
Byte 1001: 00000000
Byte 1000: 00000000 (Little Endian) or 00001010 (Big Endian)
//Consider the assignment
unsigned char* p = (unsigned char*)&a; // p points to Byte 1000, so *p = 0 or *p = 10
p+=3; // p points to Byte 1003, so *p = 10 or *p = 0
//Now consider the for loop
for(i=0;i<sizeof(a);i++){ //as integer is 4 bytes, i = 4
int d=(*p)>>4; // Right Shift is division by power of 2.
//So d = (*p)/2^4 = 0 (doesn't matter if *p is 0 or 10)
// for all the 4 loops, 1st 4 bits will be arr[0]
printf("\n%s",arr[d]);//it will print arr[0] which is 0000.
d = (*p) & 0xf;
// bitwise AND of *p with all 1's --> either 10 is assigned to d or 0 is assigned to d.
printf("%s\n",arr[d]);
// so it will print arr[0] which is 0000, or it will print arr[10]. which is 1010.
p--;
/* it will decrement p by 1. So we go to Byte 1002. This will print arr[0] for both printf's.
The loop after that (Byte 1001) will also print arr[0] for both printf's.
*/
/*
If printf is 00001010 in Byte 1003, then printf will be 00000000 in Byte 0.
This leads to the output 00001010 00000000 00000000 00000000.
If printf is 00000000 in Byte 1003, then printf will be 00001010 in Byte 0.
This leads to the output 00000000 00000000 00000000 00001010.
*/
}
Hence the solution may be either option a (big-endian) or option b (little-endian).