#1
1st September 2013, 11:10 AM
|
|||
|
|||
Difference between break statement and continue statement?
What is difference between break statement and continue statement
|
#2
15th August 2015, 01:25 AM
|
|||
|
|||
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
|
|||
|
|||
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 |
Related Topics: |
||
Thread | Replies | Last Post |
What is the difference between break statement and continue statement | 1 | 15th July 2015 09:56 AM |
|