lenelex.com
Home
Quizzes
Games
Register
Log in
Question 1 of 20
What is the output of the following code snippet?
var stack = new Stack(); stack.Push("A"); stack.Push("B"); stack.Push("C"); stack.Push("D"); //... stack.Pop(); foreach (string value in stack) { Console.Write(value); }
A. [Blank output]
B. CBA
C. DCB
D. D
Links:
Stack Class
Stack<T> Class
Collections and Data Structures