Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# goto statement

using System;  
public class GotoExample  
    {  
      public static void Main(string[] args)  
      {  
      ineligible:  
          Console.WriteLine("You are not eligible to vote!");  
  
      Console.WriteLine("Enter your age:
");  
      int age = Convert.ToInt32(Console.ReadLine());  
      if (age < 18){  
              goto ineligible;  
      }  
      else  
      {  
              Console.WriteLine("You are eligible to vote!");   
      }  
      }  
   }  
Comment

PREVIOUS NEXT
Code Example
Csharp :: listview imagelist c# 
Csharp :: microsoft forms create bitmap 
Csharp :: c# singleton 
Csharp :: color32 unity 
Csharp :: and operator in c# 
Csharp :: c# object is in object list 
Csharp :: c# structure 
Csharp :: how to create url parameters for URi C# 
Csharp :: fluent api 
Csharp :: c# optional arguments 
Csharp :: euler to quaternion 
Csharp :: join dictionaries keys c# 
Csharp :: convert string to decimal c# 
Csharp :: unity check if gameobject is inside collider 
Csharp :: C# 1 minute delay 
Csharp :: c# .net automapper profile 
Csharp :: global exception handler c# 
Csharp :: asp.net get most recent file in directory 
Csharp :: monegame deltatime 
Csharp :: give an alias in model .net 
Csharp :: c# loop 2 time tables 
Csharp :: C# order a sorted list by key 
Csharp :: how to check if an integer is in array c# 
Csharp :: how to add gravity without rb in unity 
Csharp :: Ignore case string linq c# 
Csharp :: You can get events when an object is visible within a certain camera, and when it enters or leaves, using these functions: 
Csharp :: raq query ef core 
Csharp :: How to create a new object instance from a Type 
Csharp :: ##[error]Dotnet command failed with non-zero exit code on the following projects 
Csharp :: C# Async Function simple 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =