Reading in an integer array, and stopping when a string is entered
Advertisements int [] arr = new int [100]; int count = 0; int val; arr[count] = 0; while(count < arr.Length && (int.TryParse(arr[count], out val))) { arr[count] = Convert.ToInt32.Console.ReadLine(); } I want the user to enter values for an array, and when they enter ‘exit’ the while loop breaks >Solution : You should read input first… Read More Reading in an integer array, and stopping when a string is entered