Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. void showTop(int[], int);
  4. void isFull(int[], int, int);
  5.  
  6. int main()
  7. {
  8.     const int size = 5;
  9.     int stack[size] = { 5,2,8,13,25 };
  10.     int top = 4;
  11.     showTop(stack, top);
  12.     isFull(stack, top, size);
  13.  
  14.  
  15.     system("pause");
  16.     return 0;
  17. }
  18.  
  19. void showTop(int stack[], int *top)
  20. {
  21.     cout << "top :" << top << endl;
  22. }
  23. void isFull(int stack[], int top, int size)
  24. {
  25.     if (top==stack[size])
  26.     {
  27.         cout << "stack is Full" << endl;
  28.     }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement