answersLogoWhite

0


Best Answer

Break is used to exit the closest loop. Continue will cause the program to go to the beginning of the loop.

for(int x=0;x<10;x++)

{

//continue;

for(int y=0;y<10;y++)

{

break;

}

}

The break statement causes the inner loop to stop at the first iteration. If the continue statement was uncommented, the inner loop would never be executed because the program would jump back to the beginning(until x = 10 of course).

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

in a for, do or while loop or switchbreak causes a jump out of the loop or switch.

continue causes a jump to the test part of a for, do or while loop.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

The break statement causes execution to leave the current containing loop and transfer control to the statement following the loop terminus. The continue statement causes transfer of control to the terminus, causing the next iteration of the loop to be processed, or the loop to be terminated if there are no more iterations.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Break command is used to terminate flow of control in a loop or switch statement but continue statement is used to terminate the current loop and follow the loop path again but with next value of the loop.

In other words if break command is used in a loop then that loop is terminated and control is transferred to the statement written just after the loop, but if continue statement is used in a loop then that loop is supposed to be completed and is reinitialised with next value of the loop, control is transferred to the first statement of the loop with the value of loop variable changed.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Break statement is used to transfer the control to outside the loop and switch... case , but continue statement is used to transfer the control to beginning of the loop.

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

The break statement terminates the nearest enclosing loop or switch statement.

The continue statement starts a new iteration of the nearest enclosing loop.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

to terminate a loop.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are break and continue statement in c language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you use continue statement in c language?

In C continue stements are used inside the loops like for .while,do while .its a statement used in c language wher it tell the compiler to skip the following statement(statement or part of progm following continue)&amp;continue with next iteration.it shud me noted that its diff from break statement wher the control of prog goes out of the particular loop.in case of for ,while ,or do loops when we use continue the rest of the loop will not me excecuted and it will go back to check the condition of the loop.


Difference between goto and continue statement in c language?

In continue statement, we immediately continue next step through loop In go to statement, we go to in perfect label which we call.


How do you use a C-continue statement in a block- without any looping or conditional statements?

In the C language, the continue statement can only be used within a loop (for, while, or do). Upon execution, control transfers to the beginning of the loop.


How many arithmetic statement in c?

Only one: expression. Yes, in C expression is one of the statements. Some other statements are: if, do, goto, while, for, switch, break, continue, return, NULL-statement, compound-statement.


What is the purpose of Continue and break statement in C?

The break statement is frequently used to terminate the processing of a particular case within a switch statement. Lack of an enclosing iterative or switch statement generates an error.Within nested statements, the break statement terminates only the do, for, switch, or whilestatement that immediately encloses it. You can use a returnor goto statement to transfer control elsewhere out of the nested structure.This example illustrates the break statement:#include int main() { char c; for(;;) { printf_s( "\nPress any key, Q to quit: " ); // Convert to character value scanf_s("%c", &c); if (c == 'Q') break; } } // Loop exits only when 'Q' is pressed


Why you use if and else statement in c language program?

There is no "elseif" statement in C. You can only use "else" and "if" separately. This is a good reason for switch/case/break.


What is the purpose of break statement in c?

The break statement exits control of the innermost for, while or do-while loop, or switch statement.


What is a statement in c language programme?

Any experssion including assignment or a function call can be a statement in C


What are all the looping statements in c?

1. goto 2. while-break-continue 3. for-break-continue 4. do-while-break-continue 5. recoursion


What is break in c?

The break statement is used to exit a loop or switch-case.


What is the use of continue in c?

Continue statement is used to take the control to the begining of the loop in which it is used.


What advantage does Java's break statement have over C's break statement?

They do the same thing, but only the former can be used in a Java program.