Write a MATLAB program for display star pattern


Write a MATLAB program for display star pattern as like

*
**
***
****
*****

Code:

clc;
clear;
for r = 1:5
for c = 1:r
fprintf('*');
end
fprintf('\n');
end

 


Output:






1 comment:

Powered by Blogger.