Can someone please just tell me, no links and so on. These surely are so easy for you, but not for me... : I wonder just what these two algorithms will print?
int x=1, y=0;
while(x<10) {
x = y*y;
y++;
}
System.out.println(x+" "+y);
I think this will print 4 and 5. ??and this
for(int x=0; x<5; x++)
for(int y=5; y>0; y--) {
if(x==y)
break;
if(y%2!=0)
continue;
System.out.println(y);
}
I think this will print 2 ??
Edited by WingedPanther, 28 March 2009 - 04:44 PM.
add code tags (the # button)


Sign In
Create Account


Back to top









