/******************************************************/ /* Introduction to Programming */ /* By Dr. ANTF */ /* www.antf.net */ /* Copyright 2015 */ /* */ /* C# 315 - Problem 14: Largest of a Set */ /******************************************************/ 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 x=0, max; Console.Write("Please enter a number, -1 to stop: "); x = int.Parse(Console.ReadLine()); max = x; while (x != -1) { Console.Write("Please enter a number, -1 to stop: "); x = int.Parse(Console.ReadLine()); if (max < x) max = x; } Console.WriteLine("\n\nThe largest number is: {0}", max); Console.ReadKey(); } } }