Page 1 of 1

About Question enthuware.ocpjp.v17.2.914 :

Posted: Wed Mar 01, 2023 1:23 pm
by Dario_Castagnari
Hi to everyone,

the question is "How many times is 2 printed out in the output?"

in my opinion the "2" is printed out three times, not one as checked as the correct answer.

This is the review:

This is a simple while loop nested inside a for loop. The for loop loops three times - once for each value in values array. Since, values.length is 3, x is incremented two times for each for loop iteration before the condition x<values.length returns false.
Therefore, it prints:
0 10
1 10
2 10
0 30
1 30
2 30
0 50
1 50
2 50

Maybe I misunderstand the question, who can help me understand why the option "3" is not correct?

Thank you in advance,

Dario

Re: About Question enthuware.ocpjp.v17.2.914 :

Posted: Wed Mar 01, 2023 6:08 pm
by admin
I see that 3 is indeed set as the correct answer. Can you please post a screenshot of what you see?