Solved

What Is the Output of the Following Code

Question 9

Multiple Choice

What is the output of the following code?
stackType<int> stack;
Int x,y;
x = 4;
y = 2;
stack.push(6) ;
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;


A) x = 4
B) x = 5
C) x = 6
D) x = 9

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions