Difference between a break statement and a continue statement

What is the difference between a break statement and a continue statement?

A break statement when applied to a loop ends the statement. A continue statement ends the iteration of the current loop and returns the control to the loop statement. If the break keyword is followed by an identifier that is the label of a random enclosing statement, execution transfers out of that enclosing statement. If the continue keyword is followed by an identifier that is the label of an enclosing loop, execution skips to the end of that loop instead.

What is the difference between a break statement and a continue statement?

The break and the continue statements are generally used along with a condition, which when met is executed.

However, a break statement discontinues the execution of the loop and gets the control out of the loop after meeting the condition. On the other hand the continue statement on meeting the condition, goes to the beginning of the loop and re-executes it.

What are synchronized methods and synchronized statements?
What are synchronized methods and synchronized statements? - Synchronization does not allow invocation of this Synchronized method for the same object until the first...
What is a monitor?
What is a monitor? - A monitor works as a lock on the data item. When a thread holds the monitor for some data item, other....
How do we allow one thread to wait while other to finish?
How do we allow one thread to wait while other to finish - Using the join() method, one can allow one thread to wait while other to finish....
Post your comment
Discussion Board
c programming
good views..but no up to mark difference is availeble,,,,of break and continue statement of,,,,c
tamana 01-25-2013

You may like