Question: Data Structures: Assume that you have an array-based stack that can hold up to five integers (i.e., Capacity of the stack is 5). What is
Data Structures:
Assume that you have an array-based stack that can hold up to five integers (i.e., Capacity of the stack is 5). What is the value of i at the line number 8 after the following code fragment is executed?
Stack s;
int i = 100;
s.push(11);
s.push(22);
s.push(33);
s.pop();
i = s.top();
cout << i << endl;
Select one:
a. 11
b. 22
c. 33
d. 2
e. None of the answers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
