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...


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]);
    }
  }



Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here