using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string quit = "no"; int maxCount; int count; int enteredNumber; int total = 0; // Start total at zero while (quit != "yes") { Console.Write("Enter number of values to read: "); maxCount = int.Parse(Console.ReadLine()); // Count to maxCount for (count = 0; count < maxCount; count++) { // Count range is 0 to maxCount Console.Write("Enber value {0}: ", count); enteredNumber = int.Parse(Console.ReadLine()); total = total + enteredNumber; } Console.WriteLine("Total is {0}", total); total = 0; // Clear to recalculate for new numbers Console.Write("Do you want to quit? (yes) "); quit = Console.ReadLine(); // Read text } Console.ReadKey(); // Pause } } }