Which of the following statements are true?

```
Segment 1 Segment 2
int i = 0;
for (int i = 0; i <= 20; i++) {
while (i < 20) { System.out.println(i);
i++; }
System.out.println(i);
}
```

a. The output from these segments is not the same.
b. The scope of the control variable i is different for the two segments.
c. Both (a) and (b) are true.
d. Neither (a) nor (b) is true.

c. Both (a) and (b) are true.

Computer Science & Information Technology

You might also like to view...

What is a page file used for within the Windows operating system?

What will be an ideal response?

Computer Science & Information Technology

What operator is used for the purpose of creating objects in C#?

A. new B. save C. initialize D. reserve

Computer Science & Information Technology