Implement a Stack using an Array

Write a program to implement a stack using an array with the following operations:

  • Push an element
  • Pop an element
  • Peek (get the top element)
  • Check if the stack is empty or full
Input