---
title: "how to use Goto Statement in C#"  
description: "how to use Goto Statement in C#"  
author: "Anonymous User"  
published: 2015-12-16  
updated: 2015-12-16  
canonical: https://www.mindstick.com/forum/33746/how-to-use-goto-statement-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# how to use Goto Statement in C#

I want to use Goto [Statement in C#](https://answers.mindstick.com/qa/82417/what-is-the-lock-statement-in-c-sharp) please help me\

## Replies

### Reply by Anonymous User

The goto statement is a jump statement that controls the execution of the program to another segment of the same program. You create GetReStart at anywhere in program then can pass the execution control via the goto statements.

```
using System;
namespace goto_statement{    class Program    {        static void Main(string[] args)        {            string ClassName;        GetReStart: //creating GetStart with colon(:)            Console.WriteLine("Enter Class Name:");        ClassName = Console.ReadLine();        Console.WriteLine("I am a final year {0} student ", ClassName);            goto GetReStart; //jump to GetReStart statement
        }
    }
}
```

![how to use Goto Statement in C#](https://www.mindstick.com/mindstickforums/4e8b7bc5-3f29-46a4-8873-ee227d938f40/images/cdeeec12-34d2-4944-9f34-cfc8f482ab95.png)


---

Original Source: https://www.mindstick.com/forum/33746/how-to-use-goto-statement-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
