This loop will also execute
infinitely because there is no code in its body that changes the numb variable.
The rules that you must follow can be stated as follows:
Rule 1: If there is only one statement repeated by the loop, it should appear on the line after
the while statement and be indented one additional level.
Rule 2: If the loop repeats a block, each line inside the braces should be indented.
There is no semicolon at the end of the loop header. Also note that this while loop works just like
an if statement that executes over and over again as long as the expression in the parentheses is true.
Each repetition of a loop is known as an iteration. But the important feature of this loop is that
Do'stlaringiz bilan baham: |