#1  
1st September 2013, 11:10 AM
Unregistered
Guest
 
Posts: n/a

Difference between break statement and continue statement?


What is difference between break statement and continue statement




  #2  
15th August 2015, 01:25 AM
Program complete
Senior Member++
 
Join Date: Jun 2015
Posts: 1,101
Default Re: Difference between break statement and continue statement?

**Break statement is used to transfer control of the program outside loop or switch case statement either conditionally or unconditionally.

**Break statement is used in loop as well as Switch Case Statement.
-Example::::
for(i=1;i<=10;i++)
{
if(i%5==0)
break;
else
printf("%d",&i);
}

**Continue statement is used to skip some statement of the loop and moves to the next iteration in the loop.

**Continue statement is used only within loop.
-Example:::
for(i=1;i<=10;i++)
{
if(i%5==0)
continue;
else
printf("%d",&i);
}
  #3  
15th August 2015, 10:06 PM
sai215
Senior Member
 
Join Date: Jul 2015
Posts: 170
Default Re: Difference between break statement and continue statement?

Re: Difference between break statement and Continue statement?

The Break statement is used to terminate the current enclosing loop or conditional statements in which it appears. We have already used the break statement to come out of switch statements

The Continue Statement is used to alter the sequence of Execution. Instead of coming out of the loop like the break statement did., the continue statements stop the current iteration and simply returns control back to the top of the loop.

So this are the difference between Break and Continue Statement
Do you have any question? or have anything to say?



Related Topics:

Thread Replies Last Post
What is the difference between break statement and continue statement 1 15th July 2015 09:56 AM



Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
vBulletin Optimisation by vB Optimise.
Please also check: