1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int q[5], front = 0, rear = -1, x;
  7. cout << "Enter element: ";
  8. cin >> x;
  9.  
  10. if (rear == 4)
  11. cout << "Overflow";
  12. else
  13. q[++rear] = x;
  14. cout << "\nInserted: " << q[rear];
  15. if (front > rear)
  16. cout << "\nUnderflow";
  17. else
  18. cout << "\nDeleted: " << q[front++];
  19.  
  20. return 0;
  21. }