Here arr=$\begin{pmatrix} 10& 65& 300& 400& 500\\ 100& 20& 3000& 40& 5000\\ 0& 0& 0& 0& 0\\ 0& 0& 0& 0& 0\\ 0& 0& 0& 0& 0\\ \end{pmatrix}$
arr dimension is 5*5. a is also 2D array in which each row contain 5 elements.
Suppose arr starting address is 1000 and consider integer will take 4 Bytes.
Now, a=arr so pointer a will also point to the address 1000.
The next step is ++a;
Here, a is 2D array so ++a will skip one row i.e now a points to the address 1020. (1000 + (5*4)).
The next step is char *ptr = (char*)*a;
It will create a character pointer ptr which points to the address 1020.
The next step is ++a;
++a will again skip one row i.e now a points to the address 1040. (1020 + (5*4)).
Now **a means **(a+0) which is element on 1040 address i.e 2rd row 1st element [2][1] which is 0 because here arr is initialize at compile time so all remaining value initialize as 0..
*arr[1] means **(arr+1) which is element on 1020 address i.e 1st row 1st element [1][1] which is 100.
*ptr means value on 1020 adress which is again 100.
So, Output is: 0 100 100.