The following loop displays _______________.

```
for (int i = 1; i <= 10; i++) {
System.out.print(i + " ");
i++;
}
```
a. 1 2 3 4 5 6 7 8 9
b. 1 2 3 4 5 6 7 8 9 10
c. 1 2 3 4 5
d. 1 3 5 7 9
e. 2 4 6 8 10

d. 1 3 5 7 9
In this for loop, i is initialized to 1. i++ adds 1 to i at the end of the iteration. In the action-after-each-iteration, i is again incremented by 1. So, i is in effect incremented twice. So, i is 1, then 3, 5, 7, and 9.

Computer Science & Information Technology

You might also like to view...

Sheet tab grouping can be canceled by ________

A) clicking the word Group on the title bar B) right-clicking the word Group on the title bar and selecting Ungroup C) single-clicking on any worksheet tab D) right-clicking on the tab scrolling buttons and selecting Ungroup

Computer Science & Information Technology

The Windows 8 interface begins with the ____.

A. Client screen B. Sign-in screen C. User Account screen D. Start screen

Computer Science & Information Technology