0

How and when is the while loop used?

any help pls

18th Sep 2016, 10:33 PM
Richmond Kwarteng
Richmond Kwarteng - avatar
2 Answers
+ 4
you can use while loop whenever you want to repeat an action till some condition met. and you dont know when it ends. for example you can use it in game development: while(player_status=="alive") { // keep running }
19th Sep 2016, 1:40 PM
Ilyosjon Kamoldinov
Ilyosjon Kamoldinov - avatar
0
when you want to create a loop that controled by the user...for an example only when he types his username the loop will run
25th Sep 2016, 5:11 AM
Or Orsatti
Or Orsatti - avatar