Difference b/w Break and continue statement
Using break statement,you can 'jump out of a loop' whereas by using continue statement, you can 'jump over one iteration' and then resume your loop execution.
Eg. Break Statement
  1. using System;
  2. using System.Collections;
  3. using System.Linq;
  4. using System.Text;
  5. namespace break_example {
  6. Class brk_stmt {
  7. public static void main(String [] args) {
  8. {
  9. for( int i=0; i<=5; i++) {
  10. if ( i==4) {
  11. break;
  12. }
  13. Console.ReadLine( “The number is”+i );
  14. }
  15. }
  16. }
  17. }
Output
The number is 0;
The number is 1;
The number is 2;
The number is 3;
Eg. Continue Statement
  1. using System;
  2. using System.Collections;
  3. using System.Linq;
  4. using System.Text;
  5. namespace continue_example {
  6. Class cntnu_stmt
  7. {
  8. public static void main(String [] args)
  9. {
  10. for( int i=0; i<=5; i++)
  11. {
  12. if ( i==4) {
  13. continue;
  14. }
  15. Console.ReadLine( “The number is”+i);
  16. }
  17. }
  18. }
  19. }
Output
The number is 0;
The number is 1;
The number is 2;
The number is 3;
The number is 5;