Question: code in C Figure 7 . 1 3 in the textbook ( slide 3 4 / lesson 0 7 of the generic slides ) shows
code in C Figure in the textbook slide lesson of the generic slides shows the two functions pop and push that deal with a stack of characters. Write the program by completing the main program that does the following:
Call the push function three times.
Prints out the updated stack
Calls the pop function once
Print the updated stack again.
No need to write the algorithm for this problem, it is already given to you.
#include
#define STACKEMPTY
#define STACKSIZE
void
pushchar stack inputoutput the stack
char item, input data being pushed onto the stack
int top inputoutput pointer to top of stack
int maxsize input maximum size of stack
if top maxsize
top;
stacktop item;
char
pop char stack inputoutput the stack
int top inputoutput pointer to top of stack
char item; value popped off the stack
if top
item stacktop;
top;
else
item STACKEMPTY;
return item;
int
main void
char s STACKSIZE;
int stop ; stack is empty
complete the program here
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
