Converting for loop to while loop
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Dominic Garcia
el 21 de Oct. de 2020
Comentada: Dominic Garcia
el 22 de Oct. de 2020
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/387953/image.png)
Need it as quick as possible Please, thanks
0 comentarios
Respuesta aceptada
Asad (Mehrzad) Khoddam
el 21 de Oct. de 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
Más respuestas (0)
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!