pushing the data into the stack2.
| 36 | } |
| 37 | // pushing the data into the stack2. |
| 38 | void push2(int x) |
| 39 | { |
| 40 | // Condition to check whether the stack2 is full or not |
| 41 | if(top2==N-1) |
| 42 | { |
| 43 | printf("\nStack is full.."); |
| 44 | } |
| 45 | else |
| 46 | { |
| 47 | top2++; // incrementing the value of top2. |
| 48 | stack2[top2]=x; // assigning the 'x' value to the Stack2 |
| 49 | |
| 50 | } |
| 51 | } |
| 52 | // Removing the elements from the Stack2 |
| 53 | int pop2() |
| 54 | { |