Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
Using the while loop function
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
How do i make a while loop to loop five times if the user does not enter the correct input?
0 Commenti
Risposte (1)
Pavel Osipov
il 5 Ott 2019
Modificato: Rik
il 5 Ott 2019
fa1=false;
%fa2=true;
k=0;
while k<5
k=k+1;
if fa1==false
disp('you answer is bad, try again. ');
disp('attempt = ');disp(5-k);
else
disp('you answer is good');
break;
end%if
end%while
4 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!