//Visual Basic 2010 Lineair Zoeken in Arrays Arrays public class ExerciseSolution { void Main() { int count = 3; string[] names; int[] zipCodes; Console.WriteLine("Zip Code ?"); string zipCode = Console.ReadLine(); bool found; bool exhausted; int index = -1; for (; (found || exhausted); ) { this.index += new System.EventHandler(1); found = (this.zipCodes(index) == zipCode); exhausted = (index == (count - 1)); } if (found) { Console.WriteLine(this.names(index)); } else { Console.WriteLine("City not found."); } Console.ReadLine(); } } //Bezoek www.vbvoorbeelden.be voor meer C# voorbeelden. //Copyright - De Wolf / vbvoorbeelden - 2003-2011 - Alle rechten voorbehouden.