O 4,5,8,9
0 4,5, 72
0 4,5, 72, *, +, 2, +
O None
If Push(x) and Pop() are the functions used to push and pop elements from an integer stack:
void func(char *expr)
{
int i,m,n,r;
char C;
for(i=0; i < strlen(expr);iH)
{
C=expr[i];
if(isdigit(c)
push(C-48)
else if((c=='+')||(c=='*'))
{
pop();
pop();
= (c '+') ? num : n*m;
push(r);
>
else
{
printf("Error Processing");
}
}
printf("%c", pop());
>
m =
n =
Next Question
r =
This website uses cookies. By continuing to use this website, you agree to their use. Further information about cookies can be f
O
D
Per
o Type here to search
Answers
Answered by
7
Answer:
and for 45*423*+* please anyone help
Answered by
0
Instructions that store and retrieve an item on a stack. Push enters an item on the stack, and pop retrieves an item, moving the rest of the items in the stack up one level.
Explanation:
push(20);
stack: [20]
push(4);
stack: [20, 4]
pop();
Returns 4
stack: [20]
push(10);
stack: [20, 10]
push(6);
stack: [20, 10, 6]
pop();
Returns 6
stack: [20, 10]
pop();
Returns 10
stack: [20]
push(5);
stack: [20, 5]
top();
It returns 5
stack: [20, 5]
Similar questions
English,
1 month ago
Accountancy,
1 month ago
Physics,
2 months ago
English,
10 months ago
English,
10 months ago