+ 1

How's the output 2?

In this java code how's the output is 2? https://code.sololearn.com/csSX69tB35HP/?ref=app

6th Aug 2018, 3:06 AM
Rishabh
Rishabh - avatar
1 Answer
+ 4
* Begin loop while z < 5 [z] [x] 0 0 1 0 2 0 3 1 4 2 * End loop (z < 5 evaluates to false) The following block is never executed, because value of x never gets larger than 2. { x+=7; } Hth, cmiiw
6th Aug 2018, 3:45 AM
Ipang