% Print the times table for a user-specified range

disp('Show the times table for a specified range')
lo= input('What is the lower bound? ');
hi= input('What is the upper bound? ');

% Print column headers
fprintf(' ')
for c = lo:hi
fprintf('%3d', c)
end
fprintf('\n')

for r = lo:hi % loop over rows
fprintf('%3d', r) % Print row header
for c = lo:hi % loop over columns
p = r*c;
fprintf('%3d', p); % Print product
end
fprintf('\n') % End of row
end