The correct answer is option (B).
first integer type two variables declared $i$ and $j$
then an integer type $2-d$ array $a[2][3]$ is declared and initialized and $2-d$ array $b[3][2]$ is created but not initialized. i.e
address value address value
$a[0]0[]$ $2000$ $a$ $b[0][0]$ $3000$ garbage value
$a[0][1]$ $2001$ $b$ $b[0][1]$ $3001$ garbage value
$a[0][2]$ $2002$ $c$ $b[1][0]$ $3002$ garbage value
$a[1][0]$ $2003$ $d$ $b[1][1]$ $3003$ garbage value
$a[1][1]$ $2004$ $e$ $b[2][0]$ $3004$ garbage value
$a[1][2]$ $2005$ $f$ $b[2][1]$ $3005$ garbage value
now the char type pointer is declared and the base address of array $b$ is put in it. so $p=3000$
now the for loop is started where $i$ is initialized to $0$ ,so
$i=0 : i<2$ (true)
$j=0; j<3$ (true)
$*(3000+2*0+0) =a [0][0] \Rightarrow *(3000) = a$
$j++$
$j=1; j<3$ (true)
$ *(3000+2*1+0) =a [0][1] \Rightarrow *(3002) = b$
$ j++$
$j=2; j<3$ (true)
$*(3000+2*2+0) =a [0][2] \Rightarrow *(3004) = c$
$ j++$
$j=3; j<3$ (false)
$i++$
$i=1 : i<2$ (true)
$j=0; j<3$ (true)
$*(3000+2*0+1) =a [1][0] \Rightarrow *(3001) = d$
$j++$
$j=1; j<3$ (true)
$*(3000+2*1+1) =a [1][1] \Rightarrow *(3003) = e$
$j++$
$j=2; j<3$ (true)
$ *(3000+2*2+1) =a [1][2] \Rightarrow *(3005) = f$
$j++$
$j=3; j<3$ (false)
$i++$
now the values in array $b$ is
$b[0][0]$ $3000$ $a$
$b[0][1]$ $3001$ $d$
$b[1][0]$ $3002$ $b$
$b[1][1]$ $3003$ $e$
$b[2][0]$ $3004$ $c$
$b[2][1]$ $3005$ $f$
Hence, the output will be (B) choice.
Note:
*(p + 2*j + i)
$p +$ size of inner dimension $* j + i$, hence is same as $p[j][i]$. Hence with this statement we can identify that the code is transposing the matrix $a$ and storing in $b$ using pointer $p$.