What is the result?

Given:

int x = 0;
int y = 10;
do {
y–;
++x;
} while (x < 5);
System.out.print(x + “,” + y);

What is the result?

Given:

int x = 0;
int y = 10;
do {
y–;
++x;
} while (x < 5);
System.out.print(x + “,” + y);

What is the result?

A.
5,6

B.
5,5

C.
6,5

D.
6,6



Leave a Reply 1

Your email address will not be published. Required fields are marked *


fjbo221

fjbo221

The line of “y–;” should be “y–-;”.