So, it should look like this?
Code:using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { int number; int guess; int.TryParse(Console.ReadLine, out guess); Random rand; rand = new Random(); number = rand.Next(1, 3); Start: do { Console.WriteLine("Guess the number from 1 to 3."); guess = Console.ReadLine(); if (guess == number) { Console.WriteLine("You've won."); } else { Console.WriteLine("Sorry, guess again."); goto Start; } } while (guess != "Q"); } } }




Reply With Quote
