Basic computer programming II
Basic computer programming II
✓Output: 40,35,18
✓When the continue statement appears inside nested loops, it applies to the loop immediately
enclosing it, and not to the outer loops. For example, in the following set of nested loops, the
continue statement applies to the “for” loop, and not to the “while” loop.
E.g.: while(more)
{
for(i=0;i<n;i++)
{
cin>>num; if(num<0)
continue; //causes a jump to : i++
}
}