0% found this document useful (0 votes)
19 views5 pages

Stack Program Input and Output Examples

The document outlines various stack operations including pushing and popping elements, as well as inserting and deleting data. It provides examples of user interactions for inserting numbers into a stack and the final state of the stack after operations. Additionally, it presents outputs from different operations, showcasing the results of the stack manipulations.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views5 pages

Stack Program Input and Output Examples

The document outlines various stack operations including pushing and popping elements, as well as inserting and deleting data. It provides examples of user interactions for inserting numbers into a stack and the final state of the stack after operations. Additionally, it presents outputs from different operations, showcasing the results of the stack manipulations.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Stack Programs

1.

Output

Enter ( Push or Pop ) : Push

Enter a number : 2

Enter ( Yes or no ) : yes

[2]

Enter ( Push or Pop ) : push

Enter a number : 5

Enter ( Yes or no ) : no

Thank you !!!!

2.
3.

output

Enter your choice as per given -

1 = For insert data Enter insert

2 = For delete data enter delete

3 = For Exit enter exit

Enter your choice :- insert


Enter a number :- 3

Enter your choice as per given -

1 = For insert data Enter insert

2 = For delete data enter delete

3 = For Exit enter exit

Enter your choice :- insert

Enter a number :- 4

Enter your choice as per given -

1 = For insert data Enter insert

2 = For delete data enter delete

3 = For Exit enter exit

Enter your choice :- delete

Enter your choice as per given -

1 = For insert data Enter insert

2 = For delete data enter delete

3 = For Exit enter exit

Enter your choice :- exit

Now our stack = [3]


4.

OUTPUT: 38 35 98 21 56 131

5.

OUTPUT

14 12 10 8 6 4 2
6.

OUTPUT

PBYBTLLA

You might also like