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

If you create a new comment inside of a previous comment, C1 will display following the reviewer's initials

Indicate whether the statement is true or false

Computer Science & Information Technology

If the network is unavailable during installation, which of the following is not an IP utility that can be used to troubleshoot the problem?

a. Ping b. Ipconfig c. Netstat d. dsadd

Computer Science & Information Technology