i mean if i use break in nested loop does it braught from all loop
and please give me example how to use continue statement i am not able to understand it
Break statement brings controll from one loop or form nested loop too
break statement only breaks the current loop.
for eg.
for(i=0;i<5;i++){
for(j=0;j<5;j++){
break;
}
}
break will bring you out of inner loop only.
use of continue: continue skips all remaining instructions inside loop and go into next iteration of loop.
problem: print all even numbers upto 100
for(i=0;i<100;i++){
if(i%2!=0)
continue;
print(i);
}
it will print only even numbers
thanks