Infinite loop, fixed iteration (#29697)

This commit is contained in:
Aaditree
2019-03-15 23:51:30 +05:30
committed by The Coding Aviator
parent 44264b2b3a
commit 1282227c24

View File

@ -3,7 +3,10 @@ title: While Loop
---
# While Loop
The `while` loop repeatedly executes the block of statements until the condition specified within the parentheses evaluates to `false`. For instance:
The `while` loop repeatedly executes the block of statements until the condition specified within the parentheses evaluates to `false`.
It is usually used when the number of iterations is not fixed.
For instance:
```java
while (some_condition_is_true)
@ -37,4 +40,6 @@ Output:
iter_While Value: 10
```
An infinite while loop is created when the loop remains true infinitely , maybe because there is no change in the change in value of the condition or it never turns false.
![:rocket:](//forum.freecodecamp.com/images/emoji/emoji_one/rocket.png?v=2 ":rocket:") [Run Code](https://repl.it/CJYj/0)