In Row Major Order to find address of an element
A[0..n][0....m]
to find A[p][q]=BA+[(p-0)*(m-0+1)+(q-0)]*size of element.
Here first find address of A[6][10] and A[6][9].Assume BA=P
A[6][10]= P+(6-0)*30+(10-0) // size of element=1B.
=P+180+10
=P+20*9+10 Compare with given equation i.e) ${\color{Red} P+20*j+i}$
Then j=9 and i=10 the value is derived by right side production i.e) ${\color{Red} i*30+j}$
The value of A[6][10]=10*30+9=309.
II)A[6][9]=P+(6-0)*30+(9-0)
=P+180+9
=P+20*9+9
same as above j=9 and i=9
The value is A[6][9]=9*30+9=279.
The value printed by printf is =309-279=30