1vector<int> arr = { 6, 3, 5, 2, 8 };
2vector<int>::iterator itr = std::find(arr.begin(), arr.end(), elem);
3
4if (itr != end(arr)) {
5 cout << "Element " << elem << " is present at index " << distance(arr, itr) << " in the given array";
6}
7else {
8 cout << "Element is not present in the given array";
9}