Which of the following is equivalent to this code segment?

```
Segment: int total = 0;

for (int i = 0; i <= 20; i += 2)
{
total += i;
}
```

a) int total = 0;
for (int i = 20; i < 0; i += 1)
{
total += i;
}
b) int total = 0;
for (int i = 0; i <= 20; total += i, i += 2);
c) int total = 0;
for (int i = 0, i <= 20, total += i; i += 2);
d) int total = 0;
for (int i = 2; i < 20; total += i, i += 2);

b) int total = 0;
for (int i = 0; i <= 20; total += i, i += 2);

Computer Science & Information Technology

You might also like to view...

Which image format is most commonly used for color drawings with transparency?

A) .PNG B) .MPEG C) .BMP D) .GIF

Computer Science & Information Technology

The process of determining if a model is an accurate representation of the real system is called

a. the null hypothesis. b. software engineering. c. synthesis. d. validation. e. verification.

Computer Science & Information Technology