What is the output for y?

```
int y = 0;
for (int i = 0; i < 10; ++i) {
y += i;
}
System.out.println(y);
```
a. 10
b. 11
c. 12
d. 13
e. 45


e. 45
The loop is executed 10 times for i from 0 to 9. Each time, i is added to y. So y = 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9, which 45. The correct answer is E.

Computer Science & Information Technology

You might also like to view...

A function that does not alter a linked list, but looks at the list to determine whether it’s empty, is an example of a(n) ________ function.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Which MouseEvent method can be used to determine if the Alt key is pressed?

a. isAltPressed. b. isAltDown. c. getClickCount. d. AltPressed.

Computer Science & Information Technology

The purpose of the ________ component is to jog your memory rather than to set a deadline

Fill in the blank(s) with correct word

Computer Science & Information Technology

_________________________ refers to the percentage of enlargement or reduction on the screen.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology