C#
Display the stack with the given information:
int topNum;
NumberStack stack2 = new NumberStack(5);
stack2.Push(5);stack2.Push(7);stack2.Push(12);stack2.Push(3);
public void PrintStack() { //Loop through each element of the stack and display it for (int i = size - 1 ; i >= 0; i--) { Console.WriteLine(stack[i]); } }
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here