1.

What is the output of this program?
#include <iostream>
#include <stack>
using namespace std;
int main ()
{
stack<int> StackData;
cout << (int) StackData.size();
for (int k =0; k < 5; k++)
{
StackData.push(k);
cout << " ";
cout << (int) StackData.size() << " ";
}
return 0;
}

A. 0 1
B. 0 1 2
C. 0 1 2 3
D. 0 1 2 3 4
E. 0 1 2 3 4 5
Answer» F.


Discussion

No Comment Found

Related MCQs