Info
This question is closed. Reopen it to edit or answer.
using For loop to represent positive intergers with the corresponding #. And modifying the script to write out a triangular pattern with a decreasing number of #'s on each successive line
1 view (last 30 days)
Show older comments
% a script which reads in a positive integer
% and writes out the corresponding number of “#” characters on one line
num=1;
fprintf('This program reads any positive integer');
while num>0
% print out corresponding number of #'s char on one line
fprintf('%d\n', num);
1 Comment
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!