Here are some improvements to your code so that it works no matter what size A is.
A = [1:5; 6:10; 11:15; 16:20];
A(end+1, :) = zeros(1, size(A,2));
Note that your instructions are to "change" the last row of A. That's not what your code is doing. You're adding a row of zeros. If you want to change the last row instead of adding another row,
A(end, :) = zeros(1, size(A,2));
Add a row of 0s to the end of matrix A
Replace the last row of matrix A with 0s.