-
What is the output of this program?
#include <iostream>
#include <algorithm>
using namespace std;
int main ()
{
int num[] = { 15, 25, 35, 35, 25, 15, 15, 25};
int* ptrBegin = num;
int* ptrEnd = num + sizeof(num) / sizeof(int);
ptrEnd = remove (ptrBegin, ptrEnd, 25);
for (int* ptr = ptrBegin; ptr != ptrEnd; ++ptr)
cout << ' ' << *ptr;
return 0;
}
-
- 35 35
- 15 35
- 15 15
- 15 35 35 15 15
- Compilation Error
Correct Option: D
In this program, We removed the values in the vector by using the remove method.