posted 22 years ago
Hi ,
Code1 :
-----
outer:
for( i=0; i<10; i++ ){<br /> for( j=10; j>0; j--) {
if( j== 5 ) {
continue outer; // next iteration of i
}
}
}
When at j ==5 , control goes to label outer ,
were the value of J and I kept ?
Output: 10 5
Code2:
-----
outer:
for( i=0; i<10; i++ ){<br /> for( j=10; j>0; j--) {
if( j== 5 ) {
break outer; // next iteration of i
}
}
}
When at j ==5 , control goes to label outer ,
were the value of J and I was NOT kept , right ?
Output: 0 5
Thanks
ML