-
What is the output of this program?
#include <iostream>
#include <algorithm>
using namespace std;
int main ()
{
int Array[] = {101, 201, 301, 301, 201, 101, 101, 201};
int* pbegin = Array;
int* pend = Array + sizeof(Array) / sizeof(int);
pend = remove (pbegin, pend, 201);
for (int* ptr = pbegin; ptr != pend; ++ptr)
cout << ' ' << *ptr;
return 0;
}
-
- 101
- 101 301
- 101 301 301
- 101 301 301 101
- 101 301 301 101 101
Correct Option: E
In this program, We are removing all the 201’s and then we are
printing the remaining.