Join Our WhatsApp Group Join Subscribe Now!

Data Structure Using C (313301) Practical No.16: Write a 'C' Program to perform PUSH and POP Operations on Stack using an Array

Data Structure Using C (313301) Practical No.16: Write a 'C' Program to perform PUSH and POP Operations on Stack using an Array

 Data Structure Using C (313301) Practical No.16: Write a 'C' Program to perform PUSH and POP Operations on Stack using an Array

Stacks are a fundamental data structure in computer science and have numerous practical applications based on their LIFO (Last In, First Out) properties. Hence Stack is Linear Data Structure where insertion and deletion take place only from one end called as Stack Top.

Data Structure Using C

C Program Code


Algorithm


Flowchart


Result (Output of Program)

--- Stack Operations ---
1. Push
2. Pop
3. Display
4. Exit
Enter your choice: 1
Enter the value to push: 23
23 pushed onto the stack.

--- Stack Operations ---
1. Push
2. Pop
3. Display
4. Exit
Enter your choice: 

Practical Related Questions

1. Write a C program to perform following operations on Empty stack: a. PUSH (10), PUSH (20), POP, PUSH (10), PUSH (20), POP, POP, POP, PUSH (20), POP.

Answer:



2. Write a C program to reverse a String using Stack.

Answer:



3. Write a C program to check whether the given string is palindrome or not using stack.

Answer:


Exercise

1. Enlist stack applications.

Answer:
  • Evaluation of Arithmetic Expressions
  • Backtracking
  • Delimiter Checking
  • Reverse a Data
  • Processing Function Calls

2. Consider the following stack and observe how many operations are required to delete the smallest element from given stack.

Answer:


Conclusion

We successfully completed Data Structure Using C (313301) Practical No.16 and Write a 'C' Program to perform PUSH and POP Operations on Stack using an Array.

About the Author

Hi everyone, I'm Suraj Diware, and I'm passionate about helping students succeed in MSBTE programs. This blog is dedicated to providing clear and concise explanations of MSBTE curriculum topics, along with practical tips and resources to sup…

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.