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...

________ is a Word feature that corrects commonly misspelled words automatically

Fill in the blank(s) with correct word

Computer Science & Information Technology

The financial, mathematical, and text functions that are provided by Excel are called ________ functions

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The primary purpose of a client computer is to deliver HTML documents and related resources (like images) in response to client computer requests

Indicate whether the statement is true or false.

Computer Science & Information Technology

What entity created the Interim Standards used in mobile communications?

a. Telecommunications Industry Association b. Global System Communications Industry c. International Telecommunications Union d. Global Telecommunications Association

Computer Science & Information Technology