Limited access

Upgrade to access all content for this subject

Consider the following block of code.

 int x = 5;
 int y = x;
 x++;
 y += x;
 x += y;
 y--;

What are the values of x and y at the end of the following block of code?

A

x = 10, y = 10

B

x = 17, y = 10

C

x = 6, y = 5

D

x = 17, y = 17

E

Cannot be determined, int y = x is not valid.

Select an assignment template