Consider the following statements:
stackTypestack;int x;
Suppose that the input is:
45 34 23 10 5 −999
Show what is output by the following segment of code:
stack.push(5);cin ≫ x;while (x != −999){if (x % 2 == 0){if (!stack.isFullStack ( ))stack.push(x);}elsecout ≪ “x = &“ ≪ x ≪ end1; cin ≫ x;}cout ≪ “Stack Elements: ”;while (!stack.isEmptyStack ( )){cout ≪ “ ” ≪ stack.top ( ); stack.pop ( );}cout ≪ end1;
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.