Posts

Showing posts from July, 2020

Show Step by step working of a stack of size 5? Push (8) Pop ( ) Display ( ) Push (5) Push (28) Pop ( ) Display ( ) Push (55) Pop ( ) Pop ( ) Display ( )

Show Step by step working of a stack of size 5?   Push (8) Pop ( ) Display ( ) Push (5) Push (28) Pop ( ) Display ( ) Push (55) Pop ( ) Pop ( ) Display ( )   Program: #include<iostream> using namespace std; int stack[5],n=5,top=-1,val; void push(int); void pop(); void display();   int main() {                         push(8);             pop();             display();             push(5);             push(28);             pop();             display();    ...