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
About Question enthuware.ocpjp.v17.2.914 :
Moderator: admin
-
- Posts: 2
- Joined: Wed Mar 01, 2023 1:15 pm
- Contact:
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v17.2.914 :
I see that 3 is indeed set as the correct answer. Can you please post a screenshot of what you see?
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: Google [Bot] and 91 guests