GOTO Statement in C# with Examples

Опубликовано: 17 June 2026
на канале: Dot Net Tutorials
635
5

Goto Statement in C# with Examples
In this video, I am going to discuss Goto Statement in C# with Examples. At the end of this video, you will understand the goto Statement in C# and when and how to use the goto statement in the C# language with examples.

Goto Statement in C#
The Goto Statement in C# is used to transfer the control to the labeled statement in the program. The label is a valid identifier and placed just before the statement from where the control is transferred. That means the goto Statement provides an unconditional jump from the goto to a labeled statement in the same function.

Goto is a keyword and by using this goto keyword we can pass the control anywhere in the program in the local scope. When we are working with the goto statement it required an identifier called a label. Any valid identifier followed by a colon is called a label. Whenever we are working with a goto statement it is called an unstructured control flow statement because it breaks the rule of structure programming language.

The goto statement is rarely used because it makes the program confusing, less readable, and complex. Also, when it is used, the control of the program won’t be easy to trace, hence it makes testing and debugging difficult. At the end of this video, you will understand the following pointers.

What are Goto Statement in C#?
Goto Statement in C# with Examples
Goto Statement Flowchart
Syntax to use goto statement in C# Language
Example to Understand the goto statement in C# Language
What happens if the label specified in the goto statement does not exist?
Using goto statement inside a Loop in C#
Using goto in Switch Statement
Can we print numbers from 1 to 10 without using the loop in C#?

What are Goto Statements in CSharp?
Goto Statement in CSharp with Examples
Using goto statement inside a Loop in CSharp
Using goto in Switch Statement in CSharp

The text document of this video: https://dotnettutorials.net/lesson/go...

#goto #gotocsharp #gotostatementcsharp #gotostatementexample #gotostatementexamplecsharp #gotostatementcsharpexample