add elements to stack c# code example
Example: add elements to stack c#
Stack<int> myStack = new Stack<int>();
myStack.Push(1);
myStack.Push(2);
myStack.Push(3);
myStack.Push(4);
foreach (var item in myStack)
Console.Write(item + ","); //prints 4,3,2,1,