0
Here i will post some challenge question
i found these while doing a challenge. please tell me if they are reasonable or not what is the output? int x = 0; int y = 0; for (int z = 0; z < 5; z++) { if (++x > 2 && ++y > 2) { ++x; } } System.out.println (x + y); my answer was 7. what is yours?
8 Réponses
+ 7
9
+ 5
I definitely wouldn't have been able to do it in the time limit
+ 5
The problem is that there's no time limit when you rate quizzes. That's how questions like this get approved.
0
i see. makes sense now
0
but how long did it take you to find the answer?
0
yea same. so many of these long questions
0
How would you do it?
0
this one tricked me. i forgot java doesnt evaluate all the && conditions if the first one is false