Answers for "add elements to stack c#"

1

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,
Posted by: Guest on April-17-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language