Converting for loop to while loop
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Dominic Garcia
am 21 Okt. 2020
Kommentiert: Dominic Garcia
am 22 Okt. 2020
Need it as quick as possible Please, thanks
0 Kommentare
Akzeptierte Antwort
Asad (Mehrzad) Khoddam
am 21 Okt. 2020
for i =1:5
j=1;
k=1;
while j<=5-i
fprintf(' ');
j = j+1;
end
while k<=i
fprintf('*');
k = k+1;
end
fprintf('\n')
end
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!