1.

What is the output of this program?
#include <iostream>
#include <queue>
using namespace std;
int main ()
{
queue<int> QueueData;
int add (0);
for (int k = 1; k <= 50; k++)
QueueData.push(k);
while (!QueueData.empty())
{
add += QueueData.front();
QueueData.pop();
}
cout << add << endl;
return 0;
}

A. 75
B. 1275
C. 12
D. Compilation Error
E. None of these
Answer» C. 12


Discussion

No Comment Found

Related MCQs