0
break and continue(C language)
can anyone post difference b/w break and continue with good example
4 odpowiedzi
+ 4
break - to end a whole current loop.
continue - to go to the next loop.
For example, when :
int i=0;
while(i<10)
{
i++;
if(i%3==0) {
break;
}
printf("%d", i);
}
//Output: 12
int i=0;
while(i<10)
{
i++;
if(i%3==0) {
continue;
}
printf("%d", i);
}
//Output: 124578
+ 1
Break go out of a loop orcsome section when read by the compiler,continue go over the next iteration.
+ 1
reiner A Yes
0
so it breaks while loop but not if condition right???