Given the following code fragment, what is the final value of y?

int x, y;
x = -1;
y = 0;
while(x < 3)
{
y += 2;
x += 1;
}

a. 2
b. 10
c. 6
d. 8

d. 8

Computer Science & Information Technology

You might also like to view...

To select an entire word in a document by using a mouse, ________ the word

A) double-click B) double-tap C) tap D) click

Computer Science & Information Technology

Digital audio is stored in a variety of file formats, including ___________.

A. WMA (Windows Media Audio) B. WAV C. MP3 D. all of the above

Computer Science & Information Technology