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.
You might also like to view...
Which of the following Windows 8 versions is designed for businesses?
A. Windows RT B. Windows 8 Enterprise C. Windows 8 Basic D. Windows Phone 8
To ____________________ a web site is to correct its coding errors.
Fill in the blank(s) with the appropriate word(s).
A stack element is accessed only through the ____.
Fill in the blank(s) with correct word
Which of the terms below does not have a meaning similar to the other three?
a) process b) model c) class d) abstraction