+ 2
Why we use while loop?
4 ответов
+ 10
Nitesh Gairola you have everything explained in the tutorial.
Please,
Read the COMMENTS in the lessons as you can find great examples and explanations.
+ 8
When you want to repeat code as long as a condition is satisfied.
+ 6
When we want to execute a block of code many times but we do not know the exact number of times the loop will execute, in such case we use while loop. While loop will execute till the condition specified is true, as soon as the condition becomes false the loop gets terminated.
+ 5
The while loop is used to reach an answer to which the number of iterations are not known before hand.