What is the output of the following code?stackType 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

Answer: D

Computer Science & Information Technology

You might also like to view...

The ________ is common to all OpenOffice applications and is located on the right side of the application workspace

Fill in the blank(s) with correct word

Computer Science & Information Technology

There is a standard method for assigning the weight factors in an evaluation model. 

Answer the following statement true (T) or false (F)

Computer Science & Information Technology