c++ program for Stack Using a linked list



Stack Using a linked list





OUTPUT:

1)Push
2)Pop
3)Print
4)Quit
Enter Your Choice: 1

 Enter an Element : 1


1)Push
2)Pop
3)Print
4)Quit
Enter Your Choice: 1

 Enter an Element : 2


1)Push
2)Pop
3)Print
4)Quit
Enter Your Choice: 1

 Enter an Element : 3


1)Push
2)Pop
3)Print
4)Quit
Enter Your Choice: 1

 Enter an Element : 4


1)Push
2)Pop
3)Print
4)Quit
Enter Your Choice: 2
Popped Element= 4

1)Push
2)Pop
3)Print
4)Quit
Enter Your Choice: 2
Popped Element= 3

1)Push
2)Pop
3)Print
4)Quit
Enter Your Choice: 2
Popped Element= 2

1)Push
2)Pop
3)Print
4)Quit
Enter Your Choice: 2
Popped Element= 1

1)Push
2)Pop
3)Print
4)Quit
Enter Your Choice: 2

 Underflow ******Popped Element= -1

1)Push
2)Pop
3)Print
4)Quit
Enter Your Choice: 4