Please provide solution for this question that doesn't include pointers

The solution for this question contains pointers which has not been covered in the course yet. So please provide a solution for this question which doesn’t include pointers.

hello @Mac2503
pointers are used only for declaration of 2d matrix.

if u havent studied pointers, then simply declare ur 2d matrix as.
int arr[n][m];

this will also work fine.