Converting for loop to while loop

1 回表示 (過去 30 日間)
Dominic Garcia
Dominic Garcia 2020 年 10 月 21 日
コメント済み: Dominic Garcia 2020 年 10 月 22 日
Need it as quick as possible Please, thanks

採用された回答

Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam 2020 年 10 月 21 日
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
  1 件のコメント
Dominic Garcia
Dominic Garcia 2020 年 10 月 22 日
Thank you very much sir!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by