✍️ Get Writing Help
WhatsApp

Vector

What is the output of the following C++ code?  (4)

vector intList(5);

for (int i = 0; i < 5;=””>

    intList[i] = i * (i + 1);

for (auto p : intList)

     cout < p=””>< “=”” “;=”” cout=””><>

What is the output of the following C++ code? (4)

vector intList(5);

int num = 1;

for (auto &p : intList)

 

    if (num % 2 == num % 3)

        p = 2 * num;

    else

        p = 3 * num;

    num = p – 2;

 

for (auto p : intList)

           cout < p=””>< “=”” “;=”” cout=””><>

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102