Advertisement
Fakhru

Untitled

Aug 26th, 2014
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. void push(int);
  6. void pop();
  7.  
  8. int stack[5];
  9. int top=0;
  10.  
  11. int main(void){
  12. push(10);
  13. push(20);
  14. push(30);
  15. push(40);
  16. push(50);
  17. push(60);
  18. push(70);
  19.  
  20. for(int i = 0; i < 10; i++){
  21. cout << stack[i] << endl;
  22. }
  23. system("pause");
  24. return 0;
  25. }
  26.  
  27.  
  28. void push(int a){
  29. if(top < 5){
  30. stack[top++] = a;
  31. }
  32. }
  33.  
  34. void pop(){
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement