Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Srdjan Raicevic
750 PointsFOR Loop example, cannt figure out result.. PLS help...
This is code:
public class Zadaci {
public static void main(String[] args) {
for(int x=0; x<4;x++){
for(int y=4;y>2;y--){
System.out.println(x+" "+y);
}
if(x==1){
x++;
}
}
}
}
Result is: 0 4 0 3 1 4 1 3 3 4 3 3
Can figure out why is this result, please can someone explane step by step. I would be very grateful to you.
Thank again and happy Holidays :))))))
Srdjan
Srdjan Raicevic
750 PointsSrdjan Raicevic
750 Points5min after i post this, i figure out why is this result... i will not delete this post, maybe someone who read this need explanation. :)