Multiple Choice
What is the output of the following code? stackType<int> stack;
Int x,y;
x = 5;
y = 3;
stack.push(4) ;
stack.push(x) ;
stack.push(x + 1) ;
y = stack.top() ;
stack.pop() ;
stack.push(x + y) ;
x = stack.top() ;
stack.pop() ;
cout << "x = " << x << endl;
cout << "y = " << y << endl;
A) x = 5
y = 6
B) x = 4
y = 3
C) x = 5
y = 3
D) x = 11
y = 6
Correct Answer:

Verified
Correct Answer:
Verified
Q8: Popping an element from an empty stack
Q17: The bottom element of the stack is
Q17: The addition and deletion of elements of
Q18: To describe a queuing system,we use the
Q21: What is the output of the following
Q23: What is the output of the following
Q24: In the linked implementation of stacks,the stack
Q28: The postfix expression 2 4 6 *
Q34: The postfix expression 5 6 + 4
Q39: The postfix expression 14 2 5 +