What’s wrong with the following while iteration statement?

```
while (z >= 0) {
sum += z;
}
```


The value of the variable z is never changed in the while statement. Therefore, if the loop-continuation condition (z >= 0) is initially true, an infinite loop is created. To prevent the infinite loop, z must be decremented so that it eventually becomes less than 0.

Computer Science & Information Technology

You might also like to view...

Construct Element from atomic number

What will be an ideal response?

Computer Science & Information Technology

You can also insert a manual line break to create a new line without creating a new paragraph. To do this, position the insertion point at the location in the line where you want the line to break, and then press the Shift+____ keys.

A. Insert B. Tab C. Backspace D. Enter

Computer Science & Information Technology

____ research is the careful investigation and study of the data about the target audience and the competition.

a. Target b. Data-driven c. Investigatory d. Market

Computer Science & Information Technology

Validate your tools and verify your evidence with ____ to ensure its integrity.

A. hashing algorithms B. watermarks C. steganography D. digital certificates

Computer Science & Information Technology