using System; using System.Collections; namespace Collections { class Program { static void Main(string[] args) { Queue intQueue = new Queue(); // Populate the Queue for (int i = 0; i < 5; i++) { intQueue.Enqueue((i + 1) * 10); } Console.WriteLine("Here are the items in the Queue: "); //Print each member of the Queue foreach (int i in intQueue) { Console.Write("{0} ", i.ToString()); } // Displays the first member of the Queue without removing it Console.Write("\nThe value of the first member is: {0} \n", intQueue.Peek().ToString()); // Removes the first item from the Queue and displays the remaining items intQueue.Dequeue(); Console.Write("The first item has now been removed. \nNow the remaining members are: "); //Print each member of the Queue foreach (int i in intQueue) { Console.Write("{0} ", i.ToString()); } System.Console.ReadKey(); } } }