-
What is the output of this program?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main ()
{
int num[] = { 12, 25, 39 ,42 };
int * ptr;
ptr = find (num, num + 4, 42);
--ptr;
cout << *ptr << '\n';
return 0;
}
-
- 12
- 25
- 39
- 42
- Compilation Error
Correct Option: C
In this program, We used the find method to find the value before 42.