Computer Science, asked by drthdate4275, 10 months ago

Explain the working of break and continue statements in C-language with example.

Answers

Answered by tamil98
2

int main()

{

printf("break statement example");

for(int n=0;n>=0;n++)

{

if(n%2==0)

{

printf("\n%d ",n);

break;

}

}

printf("continue statement example");

for(int n=0;n>=0;n++)

{

if(n%3==0)

{

printf("\n%d ",n);

continue;

}

}

}

OUTPUT:

break statement example

2

continue statement example

3

6

9.......48

●In break statement ,the execution of the loop exit which satisfied the condition.

●In continue statement ,the execution of the loop continue either it not satisfied the condition (for a number 4 ,5.....)

Similar questions