Hi everyone,
I'm doing a little experiment on Java loops.. I came across these infinite loops and they never wanted to stop .... Could anyone explain these loops to me, please. Thanks in advance.
for (int a=0;a <= 5; a++){
int c;
int b= 6;
for( c=0; c <= b; b++){
println("b = " + b);
if(b ==5){
println("loop terminated " + c++);
}
}
}
The idea was to get something to look like this
0
1
2
3
4
5
Loop terminated 1
0
1
2
3
4
5
Loop terminated 2 and so on till it gets to loop number 5 then breaks...