C# continue Statement2 min read

It is a loop control statement. It is used to continue the loop in the program. The use of continue inside a loop skips the remaining code and transfer the current flow of the execution to the beginning o the loop.

In case of for loop, the continue statement causes the program to jump and pass the execution to the condition and update expression by skipping further statement. Whereas in the case of while and do…while loops, the continue statement passes the control to the conditional checking expression.

continue statement Flowchart:

Continue statement in java
continue statement

Syntax of continue statement in C#:


Example of C# continue Statement

Output:


Example: C# continue program in nested loops

Output:

In the above output, i: 1, j: 2 is skipped as the continue statement stopped the further execution after that and transferred the execution control to the beginning of the outer loop.


MORE

C++ Structures

In the C/C++ programming language, the structure is user-defined data types that allow us to store the combination of different data types together. All the …
Read More

C++ Static Keyword

Static s a keyword in C++ that is when used with different types gives different meanings. static keyword can be used with variables in a …
Read More

C++ Templates

Templates in C++ are the powerful feature that allows us to write generic programs (generic classes and generic functions). A single class or function is …
Read More

C++ Friend Function

There are private and protected members in a class that is inaccessible from outside of the class, constituting one of the concepts of object-oriented programming …
Read More

this Pointer in C++

In C++, this is a keyword that refers to the current instance of a class and this pointer holds the address or points to the …
Read More

Inheritance in C++

Inheritance is one of the most important concepts of object-oriented programming. In C++, inheritance is the process of deriving the properties and behaviors of one …
Read More