/******************************************************/ /* Introduction to Programming */ /* By Dr. ANTF */ /* www.antf.net */ /* Copyright 2015 */ /* */ /* C# 304 - Problem 3: Magic Number (d) */ /******************************************************/ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DOS { class Program { static void Main(string[] args) { int number, guess = -1; Random r = new Random(); number = r.Next(1, 11); while (guess != number) { Console.Write("Guess the number: "); guess = int.Parse(Console.ReadLine()); if (guess > number) Console.WriteLine("Wrong answer, your guess is BIG\n"); else if (guess < number) Console.WriteLine("Wrong answer, your guess is SMALL\n"); } Console.WriteLine("\n\n\t\t\tBRAVO, you win!"); Console.ReadKey(); } } }